OLD | NEW |
1 /** | 1 /** |
2 * A client-side key-value store with support for indexes. | 2 * A client-side key-value store with support for indexes. |
3 * | 3 * |
4 * Many browsers support IndexedDB—a web standard for | 4 * Many browsers support IndexedDB—a web standard for |
5 * an indexed database. | 5 * an indexed database. |
6 * By storing data on the client in an IndexedDB, | 6 * By storing data on the client in an IndexedDB, |
7 * a web app gets some advantages, such as faster performance and persistence. | 7 * a web app gets some advantages, such as faster performance and persistence. |
8 * To find out which browsers support IndexedDB, | 8 * To find out which browsers support IndexedDB, |
9 * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb) | 9 * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb) |
10 * | 10 * |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 final Object primaryKey; | 263 final Object primaryKey; |
264 | 264 |
265 @DomName('IDBCursor.source') | 265 @DomName('IDBCursor.source') |
266 @DocsEditable() | 266 @DocsEditable() |
267 @Creates('Null') | 267 @Creates('Null') |
268 @Returns('ObjectStore|Index|Null') | 268 @Returns('ObjectStore|Index|Null') |
269 final Object source; | 269 final Object source; |
270 | 270 |
271 @DomName('IDBCursor.advance') | 271 @DomName('IDBCursor.advance') |
272 @DocsEditable() | 272 @DocsEditable() |
273 void advance(int count) native ; | 273 void advance(int count) native; |
274 | 274 |
275 @DomName('IDBCursor.continuePrimaryKey') | 275 @DomName('IDBCursor.continuePrimaryKey') |
276 @DocsEditable() | 276 @DocsEditable() |
277 @Experimental() // untriaged | 277 @Experimental() // untriaged |
278 void continuePrimaryKey(Object key, Object primaryKey) native ; | 278 void continuePrimaryKey(Object key, Object primaryKey) native; |
279 | 279 |
280 @JSName('delete') | 280 @JSName('delete') |
281 @DomName('IDBCursor.delete') | 281 @DomName('IDBCursor.delete') |
282 @DocsEditable() | 282 @DocsEditable() |
283 Request _delete() native ; | 283 Request _delete() native; |
284 | 284 |
285 @DomName('IDBCursor.update') | 285 @DomName('IDBCursor.update') |
286 @DocsEditable() | 286 @DocsEditable() |
287 Request _update(/*any*/ value) { | 287 Request _update(/*any*/ value) { |
288 var value_1 = convertDartToNative_SerializedScriptValue(value); | 288 var value_1 = convertDartToNative_SerializedScriptValue(value); |
289 return _update_1(value_1); | 289 return _update_1(value_1); |
290 } | 290 } |
291 | 291 |
292 @JSName('update') | 292 @JSName('update') |
293 @DomName('IDBCursor.update') | 293 @DomName('IDBCursor.update') |
294 @DocsEditable() | 294 @DocsEditable() |
295 Request _update_1(value) native ; | 295 Request _update_1(value) native; |
296 } | 296 } |
297 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 297 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
298 // for details. All rights reserved. Use of this source code is governed by a | 298 // for details. All rights reserved. Use of this source code is governed by a |
299 // BSD-style license that can be found in the LICENSE file. | 299 // BSD-style license that can be found in the LICENSE file. |
300 | 300 |
301 @DocsEditable() | 301 @DocsEditable() |
302 @DomName('IDBCursorWithValue') | 302 @DomName('IDBCursorWithValue') |
303 @Unstable() | 303 @Unstable() |
304 @Native("IDBCursorWithValue") | 304 @Native("IDBCursorWithValue") |
305 class CursorWithValue extends Cursor { | 305 class CursorWithValue extends Cursor { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } | 383 } |
384 | 384 |
385 Transaction transactionStores(DomStringList storeNames, String mode) { | 385 Transaction transactionStores(DomStringList storeNames, String mode) { |
386 if (mode != 'readonly' && mode != 'readwrite') { | 386 if (mode != 'readonly' && mode != 'readwrite') { |
387 throw new ArgumentError(mode); | 387 throw new ArgumentError(mode); |
388 } | 388 } |
389 return _transaction(storeNames, mode); | 389 return _transaction(storeNames, mode); |
390 } | 390 } |
391 | 391 |
392 @JSName('transaction') | 392 @JSName('transaction') |
393 Transaction _transaction(stores, mode) native ; | 393 Transaction _transaction(stores, mode) native; |
394 | 394 |
395 // To suppress missing implicit constructor warnings. | 395 // To suppress missing implicit constructor warnings. |
396 factory Database._() { | 396 factory Database._() { |
397 throw new UnsupportedError("Not supported"); | 397 throw new UnsupportedError("Not supported"); |
398 } | 398 } |
399 | 399 |
400 /** | 400 /** |
401 * Static factory designed to expose `abort` events to event | 401 * Static factory designed to expose `abort` events to event |
402 * handlers that are not necessarily instances of [Database]. | 402 * handlers that are not necessarily instances of [Database]. |
403 * | 403 * |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 final List<String> objectStoreNames; | 454 final List<String> objectStoreNames; |
455 | 455 |
456 @DomName('IDBDatabase.version') | 456 @DomName('IDBDatabase.version') |
457 @DocsEditable() | 457 @DocsEditable() |
458 @Creates('int|String|Null') | 458 @Creates('int|String|Null') |
459 @Returns('int|String|Null') | 459 @Returns('int|String|Null') |
460 final Object version; | 460 final Object version; |
461 | 461 |
462 @DomName('IDBDatabase.close') | 462 @DomName('IDBDatabase.close') |
463 @DocsEditable() | 463 @DocsEditable() |
464 void close() native ; | 464 void close() native; |
465 | 465 |
466 @DomName('IDBDatabase.createObjectStore') | 466 @DomName('IDBDatabase.createObjectStore') |
467 @DocsEditable() | 467 @DocsEditable() |
468 ObjectStore _createObjectStore(String name, [Map options]) { | 468 ObjectStore _createObjectStore(String name, [Map options]) { |
469 if (options != null) { | 469 if (options != null) { |
470 var options_1 = convertDartToNative_Dictionary(options); | 470 var options_1 = convertDartToNative_Dictionary(options); |
471 return _createObjectStore_1(name, options_1); | 471 return _createObjectStore_1(name, options_1); |
472 } | 472 } |
473 return _createObjectStore_2(name); | 473 return _createObjectStore_2(name); |
474 } | 474 } |
475 | 475 |
476 @JSName('createObjectStore') | 476 @JSName('createObjectStore') |
477 @DomName('IDBDatabase.createObjectStore') | 477 @DomName('IDBDatabase.createObjectStore') |
478 @DocsEditable() | 478 @DocsEditable() |
479 ObjectStore _createObjectStore_1(name, options) native ; | 479 ObjectStore _createObjectStore_1(name, options) native; |
480 @JSName('createObjectStore') | 480 @JSName('createObjectStore') |
481 @DomName('IDBDatabase.createObjectStore') | 481 @DomName('IDBDatabase.createObjectStore') |
482 @DocsEditable() | 482 @DocsEditable() |
483 ObjectStore _createObjectStore_2(name) native ; | 483 ObjectStore _createObjectStore_2(name) native; |
484 | 484 |
485 @DomName('IDBDatabase.deleteObjectStore') | 485 @DomName('IDBDatabase.deleteObjectStore') |
486 @DocsEditable() | 486 @DocsEditable() |
487 void deleteObjectStore(String name) native ; | 487 void deleteObjectStore(String name) native; |
488 | 488 |
489 /// Stream of `abort` events handled by this [Database]. | 489 /// Stream of `abort` events handled by this [Database]. |
490 @DomName('IDBDatabase.onabort') | 490 @DomName('IDBDatabase.onabort') |
491 @DocsEditable() | 491 @DocsEditable() |
492 Stream<Event> get onAbort => abortEvent.forTarget(this); | 492 Stream<Event> get onAbort => abortEvent.forTarget(this); |
493 | 493 |
494 /// Stream of `close` events handled by this [Database]. | 494 /// Stream of `close` events handled by this [Database]. |
495 @DomName('IDBDatabase.onclose') | 495 @DomName('IDBDatabase.onclose') |
496 @DocsEditable() | 496 @DocsEditable() |
497 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22540 | 497 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22540 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 this); | 602 this); |
603 } | 603 } |
604 | 604 |
605 // To suppress missing implicit constructor warnings. | 605 // To suppress missing implicit constructor warnings. |
606 factory IdbFactory._() { | 606 factory IdbFactory._() { |
607 throw new UnsupportedError("Not supported"); | 607 throw new UnsupportedError("Not supported"); |
608 } | 608 } |
609 | 609 |
610 @DomName('IDBFactory.cmp') | 610 @DomName('IDBFactory.cmp') |
611 @DocsEditable() | 611 @DocsEditable() |
612 int cmp(Object first, Object second) native ; | 612 int cmp(Object first, Object second) native; |
613 | 613 |
614 @JSName('deleteDatabase') | 614 @JSName('deleteDatabase') |
615 @DomName('IDBFactory.deleteDatabase') | 615 @DomName('IDBFactory.deleteDatabase') |
616 @DocsEditable() | 616 @DocsEditable() |
617 OpenDBRequest _deleteDatabase(String name) native ; | 617 OpenDBRequest _deleteDatabase(String name) native; |
618 | 618 |
619 @JSName('open') | 619 @JSName('open') |
620 @DomName('IDBFactory.open') | 620 @DomName('IDBFactory.open') |
621 @DocsEditable() | 621 @DocsEditable() |
622 @Returns('Request') | 622 @Returns('Request') |
623 @Creates('Request') | 623 @Creates('Request') |
624 @Creates('Database') | 624 @Creates('Database') |
625 OpenDBRequest _open(String name, [int version]) native ; | 625 OpenDBRequest _open(String name, [int version]) native; |
626 | 626 |
627 @JSName('webkitGetDatabaseNames') | 627 @JSName('webkitGetDatabaseNames') |
628 @DomName('IDBFactory.webkitGetDatabaseNames') | 628 @DomName('IDBFactory.webkitGetDatabaseNames') |
629 @DocsEditable() | 629 @DocsEditable() |
630 @SupportedBrowser(SupportedBrowser.CHROME) | 630 @SupportedBrowser(SupportedBrowser.CHROME) |
631 @SupportedBrowser(SupportedBrowser.SAFARI) | 631 @SupportedBrowser(SupportedBrowser.SAFARI) |
632 @Experimental() | 632 @Experimental() |
633 @Returns('Request') | 633 @Returns('Request') |
634 @Creates('Request') | 634 @Creates('Request') |
635 @Creates('DomStringList') | 635 @Creates('DomStringList') |
636 Request _webkitGetDatabaseNames() native ; | 636 Request _webkitGetDatabaseNames() native; |
637 } | 637 } |
638 | 638 |
639 /** | 639 /** |
640 * Ties a request to a completer, so the completer is completed when it succeeds | 640 * Ties a request to a completer, so the completer is completed when it succeeds |
641 * and errors out when the request errors. | 641 * and errors out when the request errors. |
642 */ | 642 */ |
643 Future/*<T>*/ _completeRequest/*<T>*/(Request request) { | 643 Future/*<T>*/ _completeRequest/*<T>*/(Request request) { |
644 var completer = new Completer/*<T>*/ .sync(); | 644 var completer = new Completer/*<T>*/ .sync(); |
645 // TODO: make sure that completer.complete is synchronous as transactions | 645 // TODO: make sure that completer.complete is synchronous as transactions |
646 // may be committed if the result is not processed immediately. | 646 // may be committed if the result is not processed immediately. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 @DocsEditable() | 769 @DocsEditable() |
770 final ObjectStore objectStore; | 770 final ObjectStore objectStore; |
771 | 771 |
772 @DomName('IDBIndex.unique') | 772 @DomName('IDBIndex.unique') |
773 @DocsEditable() | 773 @DocsEditable() |
774 final bool unique; | 774 final bool unique; |
775 | 775 |
776 @JSName('count') | 776 @JSName('count') |
777 @DomName('IDBIndex.count') | 777 @DomName('IDBIndex.count') |
778 @DocsEditable() | 778 @DocsEditable() |
779 Request _count(Object key) native ; | 779 Request _count(Object key) native; |
780 | 780 |
781 @JSName('get') | 781 @JSName('get') |
782 @DomName('IDBIndex.get') | 782 @DomName('IDBIndex.get') |
783 @DocsEditable() | 783 @DocsEditable() |
784 @Returns('Request') | 784 @Returns('Request') |
785 @Creates('Request') | 785 @Creates('Request') |
786 @annotation_Creates_SerializedScriptValue | 786 @annotation_Creates_SerializedScriptValue |
787 Request _get(Object key) native ; | 787 Request _get(Object key) native; |
788 | 788 |
789 @DomName('IDBIndex.getAll') | 789 @DomName('IDBIndex.getAll') |
790 @DocsEditable() | 790 @DocsEditable() |
791 @Experimental() // untriaged | 791 @Experimental() // untriaged |
792 Request getAll(Object range, [int maxCount]) native ; | 792 Request getAll(Object range, [int maxCount]) native; |
793 | 793 |
794 @DomName('IDBIndex.getAllKeys') | 794 @DomName('IDBIndex.getAllKeys') |
795 @DocsEditable() | 795 @DocsEditable() |
796 @Experimental() // untriaged | 796 @Experimental() // untriaged |
797 Request getAllKeys(Object range, [int maxCount]) native ; | 797 Request getAllKeys(Object range, [int maxCount]) native; |
798 | 798 |
799 @JSName('getKey') | 799 @JSName('getKey') |
800 @DomName('IDBIndex.getKey') | 800 @DomName('IDBIndex.getKey') |
801 @DocsEditable() | 801 @DocsEditable() |
802 @Returns('Request') | 802 @Returns('Request') |
803 @Creates('Request') | 803 @Creates('Request') |
804 @annotation_Creates_SerializedScriptValue | 804 @annotation_Creates_SerializedScriptValue |
805 @Creates('ObjectStore') | 805 @Creates('ObjectStore') |
806 Request _getKey(Object key) native ; | 806 Request _getKey(Object key) native; |
807 | 807 |
808 @JSName('openCursor') | 808 @JSName('openCursor') |
809 @DomName('IDBIndex.openCursor') | 809 @DomName('IDBIndex.openCursor') |
810 @DocsEditable() | 810 @DocsEditable() |
811 @Returns('Request') | 811 @Returns('Request') |
812 @Creates('Request') | 812 @Creates('Request') |
813 @Creates('Cursor') | 813 @Creates('Cursor') |
814 Request _openCursor(Object range, [String direction]) native ; | 814 Request _openCursor(Object range, [String direction]) native; |
815 | 815 |
816 @JSName('openKeyCursor') | 816 @JSName('openKeyCursor') |
817 @DomName('IDBIndex.openKeyCursor') | 817 @DomName('IDBIndex.openKeyCursor') |
818 @DocsEditable() | 818 @DocsEditable() |
819 @Returns('Request') | 819 @Returns('Request') |
820 @Creates('Request') | 820 @Creates('Request') |
821 @Creates('Cursor') | 821 @Creates('Cursor') |
822 Request _openKeyCursor(Object range, [String direction]) native ; | 822 Request _openKeyCursor(Object range, [String direction]) native; |
823 } | 823 } |
824 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 824 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
825 // for details. All rights reserved. Use of this source code is governed by a | 825 // for details. All rights reserved. Use of this source code is governed by a |
826 // BSD-style license that can be found in the LICENSE file. | 826 // BSD-style license that can be found in the LICENSE file. |
827 | 827 |
828 @DomName('IDBKeyRange') | 828 @DomName('IDBKeyRange') |
829 @Unstable() | 829 @Unstable() |
830 @Native("IDBKeyRange") | 830 @Native("IDBKeyRange") |
831 class KeyRange extends Interceptor { | 831 class KeyRange extends Interceptor { |
832 @DomName('IDBKeyRange.only') | 832 @DomName('IDBKeyRange.only') |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 final Object upper; | 867 final Object upper; |
868 | 868 |
869 @DomName('IDBKeyRange.upperOpen') | 869 @DomName('IDBKeyRange.upperOpen') |
870 @DocsEditable() | 870 @DocsEditable() |
871 final bool upperOpen; | 871 final bool upperOpen; |
872 | 872 |
873 @JSName('bound') | 873 @JSName('bound') |
874 @DomName('IDBKeyRange.bound') | 874 @DomName('IDBKeyRange.bound') |
875 @DocsEditable() | 875 @DocsEditable() |
876 static KeyRange bound_(Object lower, Object upper, | 876 static KeyRange bound_(Object lower, Object upper, |
877 [bool lowerOpen, bool upperOpen]) native ; | 877 [bool lowerOpen, bool upperOpen]) native; |
878 | 878 |
879 @JSName('lowerBound') | 879 @JSName('lowerBound') |
880 @DomName('IDBKeyRange.lowerBound') | 880 @DomName('IDBKeyRange.lowerBound') |
881 @DocsEditable() | 881 @DocsEditable() |
882 static KeyRange lowerBound_(Object bound, [bool open]) native ; | 882 static KeyRange lowerBound_(Object bound, [bool open]) native; |
883 | 883 |
884 @JSName('only') | 884 @JSName('only') |
885 @DomName('IDBKeyRange.only') | 885 @DomName('IDBKeyRange.only') |
886 @DocsEditable() | 886 @DocsEditable() |
887 static KeyRange only_(Object value) native ; | 887 static KeyRange only_(Object value) native; |
888 | 888 |
889 @JSName('upperBound') | 889 @JSName('upperBound') |
890 @DomName('IDBKeyRange.upperBound') | 890 @DomName('IDBKeyRange.upperBound') |
891 @DocsEditable() | 891 @DocsEditable() |
892 static KeyRange upperBound_(Object bound, [bool open]) native ; | 892 static KeyRange upperBound_(Object bound, [bool open]) native; |
893 } | 893 } |
894 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 894 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
895 // for details. All rights reserved. Use of this source code is governed by a | 895 // for details. All rights reserved. Use of this source code is governed by a |
896 // BSD-style license that can be found in the LICENSE file. | 896 // BSD-style license that can be found in the LICENSE file. |
897 | 897 |
898 @DomName('IDBObjectStore') | 898 @DomName('IDBObjectStore') |
899 @Unstable() | 899 @Unstable() |
900 @Native("IDBObjectStore") | 900 @Native("IDBObjectStore") |
901 class ObjectStore extends Interceptor { | 901 class ObjectStore extends Interceptor { |
902 @DomName('IDBObjectStore.add') | 902 @DomName('IDBObjectStore.add') |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 var value_1 = convertDartToNative_SerializedScriptValue(value); | 1067 var value_1 = convertDartToNative_SerializedScriptValue(value); |
1068 return _add_2(value_1); | 1068 return _add_2(value_1); |
1069 } | 1069 } |
1070 | 1070 |
1071 @JSName('add') | 1071 @JSName('add') |
1072 @DomName('IDBObjectStore.add') | 1072 @DomName('IDBObjectStore.add') |
1073 @DocsEditable() | 1073 @DocsEditable() |
1074 @Returns('Request') | 1074 @Returns('Request') |
1075 @Creates('Request') | 1075 @Creates('Request') |
1076 @_annotation_Creates_IDBKey | 1076 @_annotation_Creates_IDBKey |
1077 Request _add_1(value, key) native ; | 1077 Request _add_1(value, key) native; |
1078 @JSName('add') | 1078 @JSName('add') |
1079 @DomName('IDBObjectStore.add') | 1079 @DomName('IDBObjectStore.add') |
1080 @DocsEditable() | 1080 @DocsEditable() |
1081 @Returns('Request') | 1081 @Returns('Request') |
1082 @Creates('Request') | 1082 @Creates('Request') |
1083 @_annotation_Creates_IDBKey | 1083 @_annotation_Creates_IDBKey |
1084 Request _add_2(value) native ; | 1084 Request _add_2(value) native; |
1085 | 1085 |
1086 @JSName('clear') | 1086 @JSName('clear') |
1087 @DomName('IDBObjectStore.clear') | 1087 @DomName('IDBObjectStore.clear') |
1088 @DocsEditable() | 1088 @DocsEditable() |
1089 Request _clear() native ; | 1089 Request _clear() native; |
1090 | 1090 |
1091 @JSName('count') | 1091 @JSName('count') |
1092 @DomName('IDBObjectStore.count') | 1092 @DomName('IDBObjectStore.count') |
1093 @DocsEditable() | 1093 @DocsEditable() |
1094 Request _count(Object key) native ; | 1094 Request _count(Object key) native; |
1095 | 1095 |
1096 @DomName('IDBObjectStore.createIndex') | 1096 @DomName('IDBObjectStore.createIndex') |
1097 @DocsEditable() | 1097 @DocsEditable() |
1098 Index _createIndex(String name, Object keyPath, [Map options]) { | 1098 Index _createIndex(String name, Object keyPath, [Map options]) { |
1099 if (options != null) { | 1099 if (options != null) { |
1100 var options_1 = convertDartToNative_Dictionary(options); | 1100 var options_1 = convertDartToNative_Dictionary(options); |
1101 return _createIndex_1(name, keyPath, options_1); | 1101 return _createIndex_1(name, keyPath, options_1); |
1102 } | 1102 } |
1103 return _createIndex_2(name, keyPath); | 1103 return _createIndex_2(name, keyPath); |
1104 } | 1104 } |
1105 | 1105 |
1106 @JSName('createIndex') | 1106 @JSName('createIndex') |
1107 @DomName('IDBObjectStore.createIndex') | 1107 @DomName('IDBObjectStore.createIndex') |
1108 @DocsEditable() | 1108 @DocsEditable() |
1109 Index _createIndex_1(name, keyPath, options) native ; | 1109 Index _createIndex_1(name, keyPath, options) native; |
1110 @JSName('createIndex') | 1110 @JSName('createIndex') |
1111 @DomName('IDBObjectStore.createIndex') | 1111 @DomName('IDBObjectStore.createIndex') |
1112 @DocsEditable() | 1112 @DocsEditable() |
1113 Index _createIndex_2(name, keyPath) native ; | 1113 Index _createIndex_2(name, keyPath) native; |
1114 | 1114 |
1115 @JSName('delete') | 1115 @JSName('delete') |
1116 @DomName('IDBObjectStore.delete') | 1116 @DomName('IDBObjectStore.delete') |
1117 @DocsEditable() | 1117 @DocsEditable() |
1118 Request _delete(Object key) native ; | 1118 Request _delete(Object key) native; |
1119 | 1119 |
1120 @DomName('IDBObjectStore.deleteIndex') | 1120 @DomName('IDBObjectStore.deleteIndex') |
1121 @DocsEditable() | 1121 @DocsEditable() |
1122 void deleteIndex(String name) native ; | 1122 void deleteIndex(String name) native; |
1123 | 1123 |
1124 @JSName('get') | 1124 @JSName('get') |
1125 @DomName('IDBObjectStore.get') | 1125 @DomName('IDBObjectStore.get') |
1126 @DocsEditable() | 1126 @DocsEditable() |
1127 @Returns('Request') | 1127 @Returns('Request') |
1128 @Creates('Request') | 1128 @Creates('Request') |
1129 @annotation_Creates_SerializedScriptValue | 1129 @annotation_Creates_SerializedScriptValue |
1130 Request _get(Object key) native ; | 1130 Request _get(Object key) native; |
1131 | 1131 |
1132 @DomName('IDBObjectStore.getAll') | 1132 @DomName('IDBObjectStore.getAll') |
1133 @DocsEditable() | 1133 @DocsEditable() |
1134 @Experimental() // untriaged | 1134 @Experimental() // untriaged |
1135 Request getAll(Object range, [int maxCount]) native ; | 1135 Request getAll(Object range, [int maxCount]) native; |
1136 | 1136 |
1137 @DomName('IDBObjectStore.getAllKeys') | 1137 @DomName('IDBObjectStore.getAllKeys') |
1138 @DocsEditable() | 1138 @DocsEditable() |
1139 @Experimental() // untriaged | 1139 @Experimental() // untriaged |
1140 Request getAllKeys(Object range, [int maxCount]) native ; | 1140 Request getAllKeys(Object range, [int maxCount]) native; |
1141 | 1141 |
1142 @DomName('IDBObjectStore.index') | 1142 @DomName('IDBObjectStore.index') |
1143 @DocsEditable() | 1143 @DocsEditable() |
1144 Index index(String name) native ; | 1144 Index index(String name) native; |
1145 | 1145 |
1146 @JSName('openCursor') | 1146 @JSName('openCursor') |
1147 @DomName('IDBObjectStore.openCursor') | 1147 @DomName('IDBObjectStore.openCursor') |
1148 @DocsEditable() | 1148 @DocsEditable() |
1149 @Returns('Request') | 1149 @Returns('Request') |
1150 @Creates('Request') | 1150 @Creates('Request') |
1151 @Creates('Cursor') | 1151 @Creates('Cursor') |
1152 Request _openCursor(Object range, [String direction]) native ; | 1152 Request _openCursor(Object range, [String direction]) native; |
1153 | 1153 |
1154 @DomName('IDBObjectStore.openKeyCursor') | 1154 @DomName('IDBObjectStore.openKeyCursor') |
1155 @DocsEditable() | 1155 @DocsEditable() |
1156 @Experimental() // untriaged | 1156 @Experimental() // untriaged |
1157 Request openKeyCursor(Object range, [String direction]) native ; | 1157 Request openKeyCursor(Object range, [String direction]) native; |
1158 | 1158 |
1159 @DomName('IDBObjectStore.put') | 1159 @DomName('IDBObjectStore.put') |
1160 @DocsEditable() | 1160 @DocsEditable() |
1161 @Returns('Request') | 1161 @Returns('Request') |
1162 @Creates('Request') | 1162 @Creates('Request') |
1163 @_annotation_Creates_IDBKey | 1163 @_annotation_Creates_IDBKey |
1164 Request _put(/*any*/ value, [/*any*/ key]) { | 1164 Request _put(/*any*/ value, [/*any*/ key]) { |
1165 if (key != null) { | 1165 if (key != null) { |
1166 var value_1 = convertDartToNative_SerializedScriptValue(value); | 1166 var value_1 = convertDartToNative_SerializedScriptValue(value); |
1167 var key_2 = convertDartToNative_SerializedScriptValue(key); | 1167 var key_2 = convertDartToNative_SerializedScriptValue(key); |
1168 return _put_1(value_1, key_2); | 1168 return _put_1(value_1, key_2); |
1169 } | 1169 } |
1170 var value_1 = convertDartToNative_SerializedScriptValue(value); | 1170 var value_1 = convertDartToNative_SerializedScriptValue(value); |
1171 return _put_2(value_1); | 1171 return _put_2(value_1); |
1172 } | 1172 } |
1173 | 1173 |
1174 @JSName('put') | 1174 @JSName('put') |
1175 @DomName('IDBObjectStore.put') | 1175 @DomName('IDBObjectStore.put') |
1176 @DocsEditable() | 1176 @DocsEditable() |
1177 @Returns('Request') | 1177 @Returns('Request') |
1178 @Creates('Request') | 1178 @Creates('Request') |
1179 @_annotation_Creates_IDBKey | 1179 @_annotation_Creates_IDBKey |
1180 Request _put_1(value, key) native ; | 1180 Request _put_1(value, key) native; |
1181 @JSName('put') | 1181 @JSName('put') |
1182 @DomName('IDBObjectStore.put') | 1182 @DomName('IDBObjectStore.put') |
1183 @DocsEditable() | 1183 @DocsEditable() |
1184 @Returns('Request') | 1184 @Returns('Request') |
1185 @Creates('Request') | 1185 @Creates('Request') |
1186 @_annotation_Creates_IDBKey | 1186 @_annotation_Creates_IDBKey |
1187 Request _put_2(value) native ; | 1187 Request _put_2(value) native; |
1188 | 1188 |
1189 /** | 1189 /** |
1190 * Helper for iterating over cursors in a request. | 1190 * Helper for iterating over cursors in a request. |
1191 */ | 1191 */ |
1192 static Stream/*<T>*/ _cursorStreamFromResult/*<T extends Cursor>*/( | 1192 static Stream/*<T>*/ _cursorStreamFromResult/*<T extends Cursor>*/( |
1193 Request request, bool autoAdvance) { | 1193 Request request, bool autoAdvance) { |
1194 // TODO: need to guarantee that the controller provides the values | 1194 // TODO: need to guarantee that the controller provides the values |
1195 // immediately as waiting until the next tick will cause the transaction to | 1195 // immediately as waiting until the next tick will cause the transaction to |
1196 // close. | 1196 // close. |
1197 var controller = new StreamController/*<T>*/(sync: true); | 1197 var controller = new StreamController/*<T>*/(sync: true); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 | 1423 |
1424 @DomName('IDBTransaction.objectStoreNames') | 1424 @DomName('IDBTransaction.objectStoreNames') |
1425 @DocsEditable() | 1425 @DocsEditable() |
1426 @Experimental() // untriaged | 1426 @Experimental() // untriaged |
1427 @Returns('DomStringList') | 1427 @Returns('DomStringList') |
1428 @Creates('DomStringList') | 1428 @Creates('DomStringList') |
1429 final List<String> objectStoreNames; | 1429 final List<String> objectStoreNames; |
1430 | 1430 |
1431 @DomName('IDBTransaction.abort') | 1431 @DomName('IDBTransaction.abort') |
1432 @DocsEditable() | 1432 @DocsEditable() |
1433 void abort() native ; | 1433 void abort() native; |
1434 | 1434 |
1435 @DomName('IDBTransaction.objectStore') | 1435 @DomName('IDBTransaction.objectStore') |
1436 @DocsEditable() | 1436 @DocsEditable() |
1437 ObjectStore objectStore(String name) native ; | 1437 ObjectStore objectStore(String name) native; |
1438 | 1438 |
1439 /// Stream of `abort` events handled by this [Transaction]. | 1439 /// Stream of `abort` events handled by this [Transaction]. |
1440 @DomName('IDBTransaction.onabort') | 1440 @DomName('IDBTransaction.onabort') |
1441 @DocsEditable() | 1441 @DocsEditable() |
1442 Stream<Event> get onAbort => abortEvent.forTarget(this); | 1442 Stream<Event> get onAbort => abortEvent.forTarget(this); |
1443 | 1443 |
1444 /// Stream of `complete` events handled by this [Transaction]. | 1444 /// Stream of `complete` events handled by this [Transaction]. |
1445 @DomName('IDBTransaction.oncomplete') | 1445 @DomName('IDBTransaction.oncomplete') |
1446 @DocsEditable() | 1446 @DocsEditable() |
1447 Stream<Event> get onComplete => completeEvent.forTarget(this); | 1447 Stream<Event> get onComplete => completeEvent.forTarget(this); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 @Creates('int|String|Null') | 1497 @Creates('int|String|Null') |
1498 @Returns('int|String|Null') | 1498 @Returns('int|String|Null') |
1499 final int newVersion; | 1499 final int newVersion; |
1500 | 1500 |
1501 @DomName('IDBVersionChangeEvent.oldVersion') | 1501 @DomName('IDBVersionChangeEvent.oldVersion') |
1502 @DocsEditable() | 1502 @DocsEditable() |
1503 @Creates('int|String|Null') | 1503 @Creates('int|String|Null') |
1504 @Returns('int|String|Null') | 1504 @Returns('int|String|Null') |
1505 final int oldVersion; | 1505 final int oldVersion; |
1506 } | 1506 } |
OLD | NEW |