| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // DO NOT EDIT - unless you are editing documentation as per: | 5 // DO NOT EDIT - unless you are editing documentation as per: |
| 6 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation | 6 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation |
| 7 // Auto-generated dart:svg library. | 7 // Auto-generated dart:svg library. |
| 8 | 8 |
| 9 /** |
| 10 * A client-side storage mechanism with efficient data retrieval and search. |
| 11 * |
| 12 * The classes in this library provide an interface |
| 13 * to the browser's indexed database, if it has one. |
| 14 * To use this library in your code: |
| 15 * |
| 16 * import 'dart:indexed_db'; |
| 17 * |
| 18 * A web app can determine if the browser has an |
| 19 * indexed database by using the `supported` property from |
| 20 * the [IdbFactory] class: |
| 21 * |
| 22 * if (IdbFactory.supported) |
| 23 * // Use indexeddb. |
| 24 * else |
| 25 * // Find an alternative. |
| 26 * |
| 27 * Open an indexed database using the top-level [Window] object for the app. |
| 28 * For example: |
| 29 * |
| 30 * Future open() { |
| 31 * return window.indexedDB.open('myIndexedDB', |
| 32 * version: 1, |
| 33 * onUpgradeNeeded: /* Initalize the database. */ ) |
| 34 * .then( /* Load data from the database. */ ); |
| 35 * } |
| 36 * |
| 37 * ## Other resources |
| 38 * |
| 39 * For a tutorial about using this library, |
| 40 * check out |
| 41 * [Use IndexedDB](https://www.dartlang.org/docs/tutorials/indexeddb/). |
| 42 */ |
| 9 library dart.dom.indexed_db; | 43 library dart.dom.indexed_db; |
| 10 | 44 |
| 11 import 'dart:async'; | 45 import 'dart:async'; |
| 12 import 'dart:html'; | 46 import 'dart:html'; |
| 13 import 'dart:html_common'; | 47 import 'dart:html_common'; |
| 14 import 'dart:typed_data'; | 48 import 'dart:typed_data'; |
| 15 import 'dart:_js_helper' show Creates, Returns, JSName, Null; | 49 import 'dart:_js_helper' show Creates, Returns, JSName, Null; |
| 16 import 'dart:_foreign_helper' show JS; | 50 import 'dart:_foreign_helper' show JS; |
| 17 import 'dart:_interceptors' show Interceptor, JSExtendableArray; | 51 import 'dart:_interceptors' show Interceptor, JSExtendableArray; |
| 18 | 52 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 159 |
| 126 /// May modify original. If so, action is idempotent. | 160 /// May modify original. If so, action is idempotent. |
| 127 _convertNativeToDart_IDBAny(object) { | 161 _convertNativeToDart_IDBAny(object) { |
| 128 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false); | 162 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false); |
| 129 } | 163 } |
| 130 | 164 |
| 131 // TODO(sra): Add DateTime. | 165 // TODO(sra): Add DateTime. |
| 132 const String _idbKey = 'JSExtendableArray|=Object|num|String'; | 166 const String _idbKey = 'JSExtendableArray|=Object|num|String'; |
| 133 const _annotation_Creates_IDBKey = const Creates(_idbKey); | 167 const _annotation_Creates_IDBKey = const Creates(_idbKey); |
| 134 const _annotation_Returns_IDBKey = const Returns(_idbKey); | 168 const _annotation_Returns_IDBKey = const Returns(_idbKey); |
| OLD | NEW |