| OLD | NEW |
| 1 library indexed_db; | 1 library indexed_db; |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 import 'dart:html_common'; | 5 import 'dart:html_common'; |
| 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 7 // for details. All rights reserved. Use of this source code is governed by a | 7 // for details. All rights reserved. Use of this source code is governed by a |
| 8 // BSD-style license that can be found in the LICENSE file. | 8 // BSD-style license that can be found in the LICENSE file. |
| 9 | 9 |
| 10 // DO NOT EDIT | 10 // DO NOT EDIT |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 131 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 132 // for details. All rights reserved. Use of this source code is governed by a | 132 // for details. All rights reserved. Use of this source code is governed by a |
| 133 // BSD-style license that can be found in the LICENSE file. | 133 // BSD-style license that can be found in the LICENSE file. |
| 134 | 134 |
| 135 | 135 |
| 136 | 136 |
| 137 @DocsEditable | 137 @DocsEditable |
| 138 @DomName('IDBCursor') | 138 @DomName('IDBCursor') |
| 139 class Cursor native "*IDBCursor" { | 139 class Cursor native "*IDBCursor" { |
| 140 | 140 |
| 141 @DocsEditable | 141 @DocsEditable @DomName('IDBCursor.direction') |
| 142 @DomName('IDBCursor.direction') | |
| 143 final String direction; | 142 final String direction; |
| 144 | 143 |
| 145 @DocsEditable | 144 @DocsEditable @DomName('IDBCursor.key') @_annotation_Creates_IDBKey @_annotati
on_Returns_IDBKey |
| 146 @DomName('IDBCursor.key') | |
| 147 @_annotation_Creates_IDBKey | |
| 148 @_annotation_Returns_IDBKey | |
| 149 final Object key; | 145 final Object key; |
| 150 | 146 |
| 151 @DocsEditable | 147 @DocsEditable @DomName('IDBCursor.primaryKey') |
| 152 @DomName('IDBCursor.primaryKey') | |
| 153 final Object primaryKey; | 148 final Object primaryKey; |
| 154 | 149 |
| 155 @DocsEditable | 150 @DocsEditable @DomName('IDBCursor.source') |
| 156 @DomName('IDBCursor.source') | |
| 157 final dynamic source; | 151 final dynamic source; |
| 158 | 152 |
| 159 @DocsEditable | 153 @DocsEditable @DomName('IDBCursor.advance') |
| 160 @DomName('IDBCursor.advance') | |
| 161 void advance(int count) native; | 154 void advance(int count) native; |
| 162 | 155 |
| 163 void continueFunction([/*IDBKey*/ key]) { | 156 void continueFunction([/*IDBKey*/ key]) { |
| 164 if (?key) { | 157 if (?key) { |
| 165 var key_1 = _convertDartToNative_IDBKey(key); | 158 var key_1 = _convertDartToNative_IDBKey(key); |
| 166 _continueFunction_1(key_1); | 159 _continueFunction_1(key_1); |
| 167 return; | 160 return; |
| 168 } | 161 } |
| 169 _continueFunction_2(); | 162 _continueFunction_2(); |
| 170 return; | 163 return; |
| 171 } | 164 } |
| 172 @JSName('continue') | 165 @JSName('continue') |
| 173 @DocsEditable | 166 @DocsEditable @DomName('IDBCursor.continue') |
| 174 @DomName('IDBCursor.continue') | |
| 175 void _continueFunction_1(key) native; | 167 void _continueFunction_1(key) native; |
| 176 @JSName('continue') | 168 @JSName('continue') |
| 177 @DocsEditable | 169 @DocsEditable @DomName('IDBCursor.continue') |
| 178 @DomName('IDBCursor.continue') | |
| 179 void _continueFunction_2() native; | 170 void _continueFunction_2() native; |
| 180 | 171 |
| 181 @DocsEditable | 172 @DocsEditable @DomName('IDBCursor.delete') |
| 182 @DomName('IDBCursor.delete') | |
| 183 Request delete() native; | 173 Request delete() native; |
| 184 | 174 |
| 185 Request update(/*any*/ value) { | 175 Request update(/*any*/ value) { |
| 186 var value_1 = convertDartToNative_SerializedScriptValue(value); | 176 var value_1 = convertDartToNative_SerializedScriptValue(value); |
| 187 return _update_1(value_1); | 177 return _update_1(value_1); |
| 188 } | 178 } |
| 189 @JSName('update') | 179 @JSName('update') |
| 190 @DocsEditable | 180 @DocsEditable @DomName('IDBCursor.update') |
| 191 @DomName('IDBCursor.update') | |
| 192 Request _update_1(value) native; | 181 Request _update_1(value) native; |
| 193 } | 182 } |
| 194 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 183 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 195 // for details. All rights reserved. Use of this source code is governed by a | 184 // for details. All rights reserved. Use of this source code is governed by a |
| 196 // BSD-style license that can be found in the LICENSE file. | 185 // BSD-style license that can be found in the LICENSE file. |
| 197 | 186 |
| 198 | 187 |
| 199 | 188 |
| 200 @DocsEditable | 189 @DocsEditable |
| 201 @DomName('IDBCursorWithValue') | 190 @DomName('IDBCursorWithValue') |
| 202 class CursorWithValue extends Cursor native "*IDBCursorWithValue" { | 191 class CursorWithValue extends Cursor native "*IDBCursorWithValue" { |
| 203 | 192 |
| 204 @DocsEditable | 193 @DocsEditable @DomName('IDBCursorWithValue.value') @annotation_Creates_Seriali
zedScriptValue @annotation_Returns_SerializedScriptValue |
| 205 @DomName('IDBCursorWithValue.value') | |
| 206 @annotation_Creates_SerializedScriptValue | |
| 207 @annotation_Returns_SerializedScriptValue | |
| 208 final Object value; | 194 final Object value; |
| 209 } | 195 } |
| 210 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 196 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 211 // for details. All rights reserved. Use of this source code is governed by a | 197 // for details. All rights reserved. Use of this source code is governed by a |
| 212 // BSD-style license that can be found in the LICENSE file. | 198 // BSD-style license that can be found in the LICENSE file. |
| 213 | 199 |
| 214 | 200 |
| 215 @DocsEditable | 201 @DocsEditable |
| 216 @DomName('IDBDatabase') | 202 @DomName('IDBDatabase') |
| 217 @SupportedBrowser(SupportedBrowser.CHROME) | 203 @SupportedBrowser(SupportedBrowser.CHROME) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 242 | 228 |
| 243 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 229 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 244 | 230 |
| 245 static const EventStreamProvider<UpgradeNeededEvent> versionChangeEvent = cons
t EventStreamProvider<UpgradeNeededEvent>('versionchange'); | 231 static const EventStreamProvider<UpgradeNeededEvent> versionChangeEvent = cons
t EventStreamProvider<UpgradeNeededEvent>('versionchange'); |
| 246 | 232 |
| 247 @DocsEditable | 233 @DocsEditable |
| 248 @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, Event
Target.dispatchEvent') | 234 @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, Event
Target.dispatchEvent') |
| 249 DatabaseEvents get on => | 235 DatabaseEvents get on => |
| 250 new DatabaseEvents(this); | 236 new DatabaseEvents(this); |
| 251 | 237 |
| 252 @DocsEditable | 238 @DocsEditable @DomName('IDBDatabase.name') |
| 253 @DomName('IDBDatabase.name') | |
| 254 final String name; | 239 final String name; |
| 255 | 240 |
| 256 @DocsEditable | 241 @DocsEditable @DomName('IDBDatabase.objectStoreNames') |
| 257 @DomName('IDBDatabase.objectStoreNames') | 242 @Returns('DomStringList') @Creates('DomStringList') |
| 258 @Returns('DomStringList') | |
| 259 @Creates('DomStringList') | |
| 260 final List<String> objectStoreNames; | 243 final List<String> objectStoreNames; |
| 261 | 244 |
| 262 @DocsEditable | 245 @DocsEditable @DomName('IDBDatabase.version') |
| 263 @DomName('IDBDatabase.version') | |
| 264 final dynamic version; | 246 final dynamic version; |
| 265 | 247 |
| 266 @JSName('addEventListener') | 248 @JSName('addEventListener') |
| 267 @DocsEditable | 249 @DocsEditable @DomName('IDBDatabase.addEventListener') |
| 268 @DomName('IDBDatabase.addEventListener') | |
| 269 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | 250 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 270 | 251 |
| 271 @DocsEditable | 252 @DocsEditable @DomName('IDBDatabase.close') |
| 272 @DomName('IDBDatabase.close') | |
| 273 void close() native; | 253 void close() native; |
| 274 | 254 |
| 275 ObjectStore createObjectStore(String name, [Map options]) { | 255 ObjectStore createObjectStore(String name, [Map options]) { |
| 276 if (?options) { | 256 if (?options) { |
| 277 var options_1 = convertDartToNative_Dictionary(options); | 257 var options_1 = convertDartToNative_Dictionary(options); |
| 278 return _createObjectStore_1(name, options_1); | 258 return _createObjectStore_1(name, options_1); |
| 279 } | 259 } |
| 280 return _createObjectStore_2(name); | 260 return _createObjectStore_2(name); |
| 281 } | 261 } |
| 282 @JSName('createObjectStore') | 262 @JSName('createObjectStore') |
| 283 @DocsEditable | 263 @DocsEditable @DomName('IDBDatabase.createObjectStore') |
| 284 @DomName('IDBDatabase.createObjectStore') | |
| 285 ObjectStore _createObjectStore_1(name, options) native; | 264 ObjectStore _createObjectStore_1(name, options) native; |
| 286 @JSName('createObjectStore') | 265 @JSName('createObjectStore') |
| 287 @DocsEditable | 266 @DocsEditable @DomName('IDBDatabase.createObjectStore') |
| 288 @DomName('IDBDatabase.createObjectStore') | |
| 289 ObjectStore _createObjectStore_2(name) native; | 267 ObjectStore _createObjectStore_2(name) native; |
| 290 | 268 |
| 291 @DocsEditable | 269 @DocsEditable @DomName('IDBDatabase.deleteObjectStore') |
| 292 @DomName('IDBDatabase.deleteObjectStore') | |
| 293 void deleteObjectStore(String name) native; | 270 void deleteObjectStore(String name) native; |
| 294 | 271 |
| 295 @JSName('dispatchEvent') | 272 @JSName('dispatchEvent') |
| 296 @DocsEditable | 273 @DocsEditable @DomName('IDBDatabase.dispatchEvent') |
| 297 @DomName('IDBDatabase.dispatchEvent') | |
| 298 bool $dom_dispatchEvent(Event evt) native; | 274 bool $dom_dispatchEvent(Event evt) native; |
| 299 | 275 |
| 300 @JSName('removeEventListener') | 276 @JSName('removeEventListener') |
| 301 @DocsEditable | 277 @DocsEditable @DomName('IDBDatabase.removeEventListener') |
| 302 @DomName('IDBDatabase.removeEventListener') | |
| 303 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 278 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 304 | 279 |
| 305 Stream<Event> get onAbort => abortEvent.forTarget(this); | 280 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 306 | 281 |
| 307 Stream<Event> get onError => errorEvent.forTarget(this); | 282 Stream<Event> get onError => errorEvent.forTarget(this); |
| 308 | 283 |
| 309 Stream<UpgradeNeededEvent> get onVersionChange => versionChangeEvent.forTarget
(this); | 284 Stream<UpgradeNeededEvent> get onVersionChange => versionChangeEvent.forTarget
(this); |
| 310 } | 285 } |
| 311 | 286 |
| 312 @DocsEditable | 287 @DocsEditable |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 'window.mozIndexedDB)'); | 320 'window.mozIndexedDB)'); |
| 346 } | 321 } |
| 347 | 322 |
| 348 | 323 |
| 349 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) { | 324 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) { |
| 350 var first_1 = _convertDartToNative_IDBKey(first); | 325 var first_1 = _convertDartToNative_IDBKey(first); |
| 351 var second_2 = _convertDartToNative_IDBKey(second); | 326 var second_2 = _convertDartToNative_IDBKey(second); |
| 352 return _cmp_1(first_1, second_2); | 327 return _cmp_1(first_1, second_2); |
| 353 } | 328 } |
| 354 @JSName('cmp') | 329 @JSName('cmp') |
| 355 @DocsEditable | 330 @DocsEditable @DomName('IDBFactory.cmp') |
| 356 @DomName('IDBFactory.cmp') | |
| 357 int _cmp_1(first, second) native; | 331 int _cmp_1(first, second) native; |
| 358 | 332 |
| 359 @DocsEditable | 333 @DocsEditable @DomName('IDBFactory.deleteDatabase') |
| 360 @DomName('IDBFactory.deleteDatabase') | |
| 361 VersionChangeRequest deleteDatabase(String name) native; | 334 VersionChangeRequest deleteDatabase(String name) native; |
| 362 | 335 |
| 363 @DocsEditable | 336 @DocsEditable @DomName('IDBFactory.open') @Returns('Request') @Creates('Reques
t') @Creates('Database') |
| 364 @DomName('IDBFactory.open') | |
| 365 OpenDBRequest open(String name, [int version]) native; | 337 OpenDBRequest open(String name, [int version]) native; |
| 366 | 338 |
| 367 @DocsEditable | 339 @DocsEditable @DomName('IDBFactory.webkitGetDatabaseNames') |
| 368 @DomName('IDBFactory.webkitGetDatabaseNames') | |
| 369 Request webkitGetDatabaseNames() native; | 340 Request webkitGetDatabaseNames() native; |
| 370 | 341 |
| 371 } | 342 } |
| 372 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 343 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 373 // for details. All rights reserved. Use of this source code is governed by a | 344 // for details. All rights reserved. Use of this source code is governed by a |
| 374 // BSD-style license that can be found in the LICENSE file. | 345 // BSD-style license that can be found in the LICENSE file. |
| 375 | 346 |
| 376 | 347 |
| 377 | 348 |
| 378 @DocsEditable | 349 @DocsEditable |
| 379 @DomName('IDBIndex') | 350 @DomName('IDBIndex') |
| 380 class Index native "*IDBIndex" { | 351 class Index native "*IDBIndex" { |
| 381 | 352 |
| 382 @DocsEditable | 353 @DocsEditable @DomName('IDBIndex.keyPath') |
| 383 @DomName('IDBIndex.keyPath') | |
| 384 final dynamic keyPath; | 354 final dynamic keyPath; |
| 385 | 355 |
| 386 @DocsEditable | 356 @DocsEditable @DomName('IDBIndex.multiEntry') |
| 387 @DomName('IDBIndex.multiEntry') | |
| 388 final bool multiEntry; | 357 final bool multiEntry; |
| 389 | 358 |
| 390 @DocsEditable | 359 @DocsEditable @DomName('IDBIndex.name') |
| 391 @DomName('IDBIndex.name') | |
| 392 final String name; | 360 final String name; |
| 393 | 361 |
| 394 @DocsEditable | 362 @DocsEditable @DomName('IDBIndex.objectStore') |
| 395 @DomName('IDBIndex.objectStore') | |
| 396 final ObjectStore objectStore; | 363 final ObjectStore objectStore; |
| 397 | 364 |
| 398 @DocsEditable | 365 @DocsEditable @DomName('IDBIndex.unique') |
| 399 @DomName('IDBIndex.unique') | |
| 400 final bool unique; | 366 final bool unique; |
| 401 | 367 |
| 402 Request count([key_OR_range]) { | 368 Request count([key_OR_range]) { |
| 403 if (!?key_OR_range) { | 369 if (!?key_OR_range) { |
| 404 return _count_1(); | 370 return _count_1(); |
| 405 } | 371 } |
| 406 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 372 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 407 return _count_2(key_OR_range); | 373 return _count_2(key_OR_range); |
| 408 } | 374 } |
| 409 if (?key_OR_range) { | 375 if (?key_OR_range) { |
| 410 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | 376 var key_1 = _convertDartToNative_IDBKey(key_OR_range); |
| 411 return _count_3(key_1); | 377 return _count_3(key_1); |
| 412 } | 378 } |
| 413 throw new ArgumentError("Incorrect number or type of arguments"); | 379 throw new ArgumentError("Incorrect number or type of arguments"); |
| 414 } | 380 } |
| 415 @JSName('count') | 381 @JSName('count') |
| 416 @DocsEditable | 382 @DocsEditable @DomName('IDBIndex.count') |
| 417 @DomName('IDBIndex.count') | |
| 418 Request _count_1() native; | 383 Request _count_1() native; |
| 419 @JSName('count') | 384 @JSName('count') |
| 420 @DocsEditable | 385 @DocsEditable @DomName('IDBIndex.count') |
| 421 @DomName('IDBIndex.count') | |
| 422 Request _count_2(KeyRange range) native; | 386 Request _count_2(KeyRange range) native; |
| 423 @JSName('count') | 387 @JSName('count') |
| 424 @DocsEditable | 388 @DocsEditable @DomName('IDBIndex.count') |
| 425 @DomName('IDBIndex.count') | |
| 426 Request _count_3(key) native; | 389 Request _count_3(key) native; |
| 427 | 390 |
| 428 Request get(key) { | 391 Request get(key) { |
| 429 if ((key is KeyRange || key == null)) { | 392 if ((key is KeyRange || key == null)) { |
| 430 return _get_1(key); | 393 return _get_1(key); |
| 431 } | 394 } |
| 432 if (?key) { | 395 if (?key) { |
| 433 var key_1 = _convertDartToNative_IDBKey(key); | 396 var key_1 = _convertDartToNative_IDBKey(key); |
| 434 return _get_2(key_1); | 397 return _get_2(key_1); |
| 435 } | 398 } |
| 436 throw new ArgumentError("Incorrect number or type of arguments"); | 399 throw new ArgumentError("Incorrect number or type of arguments"); |
| 437 } | 400 } |
| 438 @JSName('get') | 401 @JSName('get') |
| 439 @DocsEditable | 402 @DocsEditable @DomName('IDBIndex.get') @Returns('Request') @Creates('Request')
@annotation_Creates_SerializedScriptValue |
| 440 @DomName('IDBIndex.get') | |
| 441 Request _get_1(KeyRange key) native; | 403 Request _get_1(KeyRange key) native; |
| 442 @JSName('get') | 404 @JSName('get') |
| 443 @DocsEditable | 405 @DocsEditable @DomName('IDBIndex.get') @Returns('Request') @Creates('Request')
@annotation_Creates_SerializedScriptValue |
| 444 @DomName('IDBIndex.get') | |
| 445 Request _get_2(key) native; | 406 Request _get_2(key) native; |
| 446 | 407 |
| 447 Request getKey(key) { | 408 Request getKey(key) { |
| 448 if ((key is KeyRange || key == null)) { | 409 if ((key is KeyRange || key == null)) { |
| 449 return _getKey_1(key); | 410 return _getKey_1(key); |
| 450 } | 411 } |
| 451 if (?key) { | 412 if (?key) { |
| 452 var key_1 = _convertDartToNative_IDBKey(key); | 413 var key_1 = _convertDartToNative_IDBKey(key); |
| 453 return _getKey_2(key_1); | 414 return _getKey_2(key_1); |
| 454 } | 415 } |
| 455 throw new ArgumentError("Incorrect number or type of arguments"); | 416 throw new ArgumentError("Incorrect number or type of arguments"); |
| 456 } | 417 } |
| 457 @JSName('getKey') | 418 @JSName('getKey') |
| 458 @DocsEditable | 419 @DocsEditable @DomName('IDBIndex.getKey') @Returns('Request') @Creates('Reques
t') @annotation_Creates_SerializedScriptValue @Creates('ObjectStore') |
| 459 @DomName('IDBIndex.getKey') | |
| 460 Request _getKey_1(KeyRange key) native; | 420 Request _getKey_1(KeyRange key) native; |
| 461 @JSName('getKey') | 421 @JSName('getKey') |
| 462 @DocsEditable | 422 @DocsEditable @DomName('IDBIndex.getKey') @Returns('Request') @Creates('Reques
t') @annotation_Creates_SerializedScriptValue @Creates('ObjectStore') |
| 463 @DomName('IDBIndex.getKey') | |
| 464 Request _getKey_2(key) native; | 423 Request _getKey_2(key) native; |
| 465 | 424 |
| 466 Request openCursor([key_OR_range, String direction]) { | 425 Request openCursor([key_OR_range, String direction]) { |
| 467 if (!?key_OR_range && | 426 if (!?key_OR_range && |
| 468 !?direction) { | 427 !?direction) { |
| 469 return _openCursor_1(); | 428 return _openCursor_1(); |
| 470 } | 429 } |
| 471 if ((key_OR_range is KeyRange || key_OR_range == null) && | 430 if ((key_OR_range is KeyRange || key_OR_range == null) && |
| 472 !?direction) { | 431 !?direction) { |
| 473 return _openCursor_2(key_OR_range); | 432 return _openCursor_2(key_OR_range); |
| 474 } | 433 } |
| 475 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 434 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 476 return _openCursor_3(key_OR_range, direction); | 435 return _openCursor_3(key_OR_range, direction); |
| 477 } | 436 } |
| 478 if (?key_OR_range && | 437 if (?key_OR_range && |
| 479 !?direction) { | 438 !?direction) { |
| 480 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | 439 var key_1 = _convertDartToNative_IDBKey(key_OR_range); |
| 481 return _openCursor_4(key_1); | 440 return _openCursor_4(key_1); |
| 482 } | 441 } |
| 483 if (?key_OR_range) { | 442 if (?key_OR_range) { |
| 484 var key_2 = _convertDartToNative_IDBKey(key_OR_range); | 443 var key_2 = _convertDartToNative_IDBKey(key_OR_range); |
| 485 return _openCursor_5(key_2, direction); | 444 return _openCursor_5(key_2, direction); |
| 486 } | 445 } |
| 487 throw new ArgumentError("Incorrect number or type of arguments"); | 446 throw new ArgumentError("Incorrect number or type of arguments"); |
| 488 } | 447 } |
| 489 @JSName('openCursor') | 448 @JSName('openCursor') |
| 490 @DocsEditable | 449 @DocsEditable @DomName('IDBIndex.openCursor') @Returns('Request') @Creates('Re
quest') @Creates('Cursor') |
| 491 @DomName('IDBIndex.openCursor') | |
| 492 Request _openCursor_1() native; | 450 Request _openCursor_1() native; |
| 493 @JSName('openCursor') | 451 @JSName('openCursor') |
| 494 @DocsEditable | 452 @DocsEditable @DomName('IDBIndex.openCursor') @Returns('Request') @Creates('Re
quest') @Creates('Cursor') |
| 495 @DomName('IDBIndex.openCursor') | |
| 496 Request _openCursor_2(KeyRange range) native; | 453 Request _openCursor_2(KeyRange range) native; |
| 497 @JSName('openCursor') | 454 @JSName('openCursor') |
| 498 @DocsEditable | 455 @DocsEditable @DomName('IDBIndex.openCursor') @Returns('Request') @Creates('Re
quest') @Creates('Cursor') |
| 499 @DomName('IDBIndex.openCursor') | |
| 500 Request _openCursor_3(KeyRange range, direction) native; | 456 Request _openCursor_3(KeyRange range, direction) native; |
| 501 @JSName('openCursor') | 457 @JSName('openCursor') |
| 502 @DocsEditable | 458 @DocsEditable @DomName('IDBIndex.openCursor') @Returns('Request') @Creates('Re
quest') @Creates('Cursor') |
| 503 @DomName('IDBIndex.openCursor') | |
| 504 Request _openCursor_4(key) native; | 459 Request _openCursor_4(key) native; |
| 505 @JSName('openCursor') | 460 @JSName('openCursor') |
| 506 @DocsEditable | 461 @DocsEditable @DomName('IDBIndex.openCursor') @Returns('Request') @Creates('Re
quest') @Creates('Cursor') |
| 507 @DomName('IDBIndex.openCursor') | |
| 508 Request _openCursor_5(key, direction) native; | 462 Request _openCursor_5(key, direction) native; |
| 509 | 463 |
| 510 Request openKeyCursor([key_OR_range, String direction]) { | 464 Request openKeyCursor([key_OR_range, String direction]) { |
| 511 if (!?key_OR_range && | 465 if (!?key_OR_range && |
| 512 !?direction) { | 466 !?direction) { |
| 513 return _openKeyCursor_1(); | 467 return _openKeyCursor_1(); |
| 514 } | 468 } |
| 515 if ((key_OR_range is KeyRange || key_OR_range == null) && | 469 if ((key_OR_range is KeyRange || key_OR_range == null) && |
| 516 !?direction) { | 470 !?direction) { |
| 517 return _openKeyCursor_2(key_OR_range); | 471 return _openKeyCursor_2(key_OR_range); |
| 518 } | 472 } |
| 519 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 473 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 520 return _openKeyCursor_3(key_OR_range, direction); | 474 return _openKeyCursor_3(key_OR_range, direction); |
| 521 } | 475 } |
| 522 if (?key_OR_range && | 476 if (?key_OR_range && |
| 523 !?direction) { | 477 !?direction) { |
| 524 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | 478 var key_1 = _convertDartToNative_IDBKey(key_OR_range); |
| 525 return _openKeyCursor_4(key_1); | 479 return _openKeyCursor_4(key_1); |
| 526 } | 480 } |
| 527 if (?key_OR_range) { | 481 if (?key_OR_range) { |
| 528 var key_2 = _convertDartToNative_IDBKey(key_OR_range); | 482 var key_2 = _convertDartToNative_IDBKey(key_OR_range); |
| 529 return _openKeyCursor_5(key_2, direction); | 483 return _openKeyCursor_5(key_2, direction); |
| 530 } | 484 } |
| 531 throw new ArgumentError("Incorrect number or type of arguments"); | 485 throw new ArgumentError("Incorrect number or type of arguments"); |
| 532 } | 486 } |
| 533 @JSName('openKeyCursor') | 487 @JSName('openKeyCursor') |
| 534 @DocsEditable | 488 @DocsEditable @DomName('IDBIndex.openKeyCursor') @Returns('Request') @Creates(
'Request') @Creates('Cursor') |
| 535 @DomName('IDBIndex.openKeyCursor') | |
| 536 Request _openKeyCursor_1() native; | 489 Request _openKeyCursor_1() native; |
| 537 @JSName('openKeyCursor') | 490 @JSName('openKeyCursor') |
| 538 @DocsEditable | 491 @DocsEditable @DomName('IDBIndex.openKeyCursor') @Returns('Request') @Creates(
'Request') @Creates('Cursor') |
| 539 @DomName('IDBIndex.openKeyCursor') | |
| 540 Request _openKeyCursor_2(KeyRange range) native; | 492 Request _openKeyCursor_2(KeyRange range) native; |
| 541 @JSName('openKeyCursor') | 493 @JSName('openKeyCursor') |
| 542 @DocsEditable | 494 @DocsEditable @DomName('IDBIndex.openKeyCursor') @Returns('Request') @Creates(
'Request') @Creates('Cursor') |
| 543 @DomName('IDBIndex.openKeyCursor') | |
| 544 Request _openKeyCursor_3(KeyRange range, direction) native; | 495 Request _openKeyCursor_3(KeyRange range, direction) native; |
| 545 @JSName('openKeyCursor') | 496 @JSName('openKeyCursor') |
| 546 @DocsEditable | 497 @DocsEditable @DomName('IDBIndex.openKeyCursor') @Returns('Request') @Creates(
'Request') @Creates('Cursor') |
| 547 @DomName('IDBIndex.openKeyCursor') | |
| 548 Request _openKeyCursor_4(key) native; | 498 Request _openKeyCursor_4(key) native; |
| 549 @JSName('openKeyCursor') | 499 @JSName('openKeyCursor') |
| 550 @DocsEditable | 500 @DocsEditable @DomName('IDBIndex.openKeyCursor') @Returns('Request') @Creates(
'Request') @Creates('Cursor') |
| 551 @DomName('IDBIndex.openKeyCursor') | |
| 552 Request _openKeyCursor_5(key, direction) native; | 501 Request _openKeyCursor_5(key, direction) native; |
| 553 } | 502 } |
| 554 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 503 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 555 // for details. All rights reserved. Use of this source code is governed by a | 504 // for details. All rights reserved. Use of this source code is governed by a |
| 556 // BSD-style license that can be found in the LICENSE file. | 505 // BSD-style license that can be found in the LICENSE file. |
| 557 | 506 |
| 558 | 507 |
| 559 | 508 |
| 560 @DocsEditable | 509 @DocsEditable |
| 561 @DomName('IDBKey') | 510 @DomName('IDBKey') |
| (...skipping 21 matching lines...) Expand all Loading... |
| 583 | 532 |
| 584 @DomName('KeyRange.bound') | 533 @DomName('KeyRange.bound') |
| 585 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, | 534 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, |
| 586 [bool lowerOpen = false, bool upperOpen = false]) => | 535 [bool lowerOpen = false, bool upperOpen = false]) => |
| 587 _KeyRangeFactoryProvider.createKeyRange_bound( | 536 _KeyRangeFactoryProvider.createKeyRange_bound( |
| 588 lower, upper, lowerOpen, upperOpen); | 537 lower, upper, lowerOpen, upperOpen); |
| 589 | 538 |
| 590 | 539 |
| 591 dynamic get lower => _convertNativeToDart_IDBKey(this._lower); | 540 dynamic get lower => _convertNativeToDart_IDBKey(this._lower); |
| 592 @JSName('lower') | 541 @JSName('lower') |
| 593 @DocsEditable | 542 @DocsEditable @DomName('IDBKeyRange.lower') |
| 594 @DomName('IDBKeyRange.lower') | |
| 595 final dynamic _lower; | 543 final dynamic _lower; |
| 596 | 544 |
| 597 @DocsEditable | 545 @DocsEditable @DomName('IDBKeyRange.lowerOpen') |
| 598 @DomName('IDBKeyRange.lowerOpen') | |
| 599 final bool lowerOpen; | 546 final bool lowerOpen; |
| 600 | 547 |
| 601 dynamic get upper => _convertNativeToDart_IDBKey(this._upper); | 548 dynamic get upper => _convertNativeToDart_IDBKey(this._upper); |
| 602 @JSName('upper') | 549 @JSName('upper') |
| 603 @DocsEditable | 550 @DocsEditable @DomName('IDBKeyRange.upper') |
| 604 @DomName('IDBKeyRange.upper') | |
| 605 final dynamic _upper; | 551 final dynamic _upper; |
| 606 | 552 |
| 607 @DocsEditable | 553 @DocsEditable @DomName('IDBKeyRange.upperOpen') |
| 608 @DomName('IDBKeyRange.upperOpen') | |
| 609 final bool upperOpen; | 554 final bool upperOpen; |
| 610 | 555 |
| 611 static KeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bo
ol upperOpen]) { | 556 static KeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bo
ol upperOpen]) { |
| 612 if (?upperOpen) { | 557 if (?upperOpen) { |
| 613 var lower_1 = _convertDartToNative_IDBKey(lower); | 558 var lower_1 = _convertDartToNative_IDBKey(lower); |
| 614 var upper_2 = _convertDartToNative_IDBKey(upper); | 559 var upper_2 = _convertDartToNative_IDBKey(upper); |
| 615 return _bound__1(lower_1, upper_2, lowerOpen, upperOpen); | 560 return _bound__1(lower_1, upper_2, lowerOpen, upperOpen); |
| 616 } | 561 } |
| 617 if (?lowerOpen) { | 562 if (?lowerOpen) { |
| 618 var lower_3 = _convertDartToNative_IDBKey(lower); | 563 var lower_3 = _convertDartToNative_IDBKey(lower); |
| 619 var upper_4 = _convertDartToNative_IDBKey(upper); | 564 var upper_4 = _convertDartToNative_IDBKey(upper); |
| 620 return _bound__2(lower_3, upper_4, lowerOpen); | 565 return _bound__2(lower_3, upper_4, lowerOpen); |
| 621 } | 566 } |
| 622 var lower_5 = _convertDartToNative_IDBKey(lower); | 567 var lower_5 = _convertDartToNative_IDBKey(lower); |
| 623 var upper_6 = _convertDartToNative_IDBKey(upper); | 568 var upper_6 = _convertDartToNative_IDBKey(upper); |
| 624 return _bound__3(lower_5, upper_6); | 569 return _bound__3(lower_5, upper_6); |
| 625 } | 570 } |
| 626 @JSName('bound') | 571 @JSName('bound') |
| 627 @DocsEditable | 572 @DocsEditable @DomName('IDBKeyRange.bound') |
| 628 @DomName('IDBKeyRange.bound') | |
| 629 static KeyRange _bound__1(lower, upper, lowerOpen, upperOpen) native; | 573 static KeyRange _bound__1(lower, upper, lowerOpen, upperOpen) native; |
| 630 @JSName('bound') | 574 @JSName('bound') |
| 631 @DocsEditable | 575 @DocsEditable @DomName('IDBKeyRange.bound') |
| 632 @DomName('IDBKeyRange.bound') | |
| 633 static KeyRange _bound__2(lower, upper, lowerOpen) native; | 576 static KeyRange _bound__2(lower, upper, lowerOpen) native; |
| 634 @JSName('bound') | 577 @JSName('bound') |
| 635 @DocsEditable | 578 @DocsEditable @DomName('IDBKeyRange.bound') |
| 636 @DomName('IDBKeyRange.bound') | |
| 637 static KeyRange _bound__3(lower, upper) native; | 579 static KeyRange _bound__3(lower, upper) native; |
| 638 | 580 |
| 639 static KeyRange lowerBound_(/*IDBKey*/ bound, [bool open]) { | 581 static KeyRange lowerBound_(/*IDBKey*/ bound, [bool open]) { |
| 640 if (?open) { | 582 if (?open) { |
| 641 var bound_1 = _convertDartToNative_IDBKey(bound); | 583 var bound_1 = _convertDartToNative_IDBKey(bound); |
| 642 return _lowerBound__1(bound_1, open); | 584 return _lowerBound__1(bound_1, open); |
| 643 } | 585 } |
| 644 var bound_2 = _convertDartToNative_IDBKey(bound); | 586 var bound_2 = _convertDartToNative_IDBKey(bound); |
| 645 return _lowerBound__2(bound_2); | 587 return _lowerBound__2(bound_2); |
| 646 } | 588 } |
| 647 @JSName('lowerBound') | 589 @JSName('lowerBound') |
| 648 @DocsEditable | 590 @DocsEditable @DomName('IDBKeyRange.lowerBound') |
| 649 @DomName('IDBKeyRange.lowerBound') | |
| 650 static KeyRange _lowerBound__1(bound, open) native; | 591 static KeyRange _lowerBound__1(bound, open) native; |
| 651 @JSName('lowerBound') | 592 @JSName('lowerBound') |
| 652 @DocsEditable | 593 @DocsEditable @DomName('IDBKeyRange.lowerBound') |
| 653 @DomName('IDBKeyRange.lowerBound') | |
| 654 static KeyRange _lowerBound__2(bound) native; | 594 static KeyRange _lowerBound__2(bound) native; |
| 655 | 595 |
| 656 static KeyRange only_(/*IDBKey*/ value) { | 596 static KeyRange only_(/*IDBKey*/ value) { |
| 657 var value_1 = _convertDartToNative_IDBKey(value); | 597 var value_1 = _convertDartToNative_IDBKey(value); |
| 658 return _only__1(value_1); | 598 return _only__1(value_1); |
| 659 } | 599 } |
| 660 @JSName('only') | 600 @JSName('only') |
| 661 @DocsEditable | 601 @DocsEditable @DomName('IDBKeyRange.only') |
| 662 @DomName('IDBKeyRange.only') | |
| 663 static KeyRange _only__1(value) native; | 602 static KeyRange _only__1(value) native; |
| 664 | 603 |
| 665 static KeyRange upperBound_(/*IDBKey*/ bound, [bool open]) { | 604 static KeyRange upperBound_(/*IDBKey*/ bound, [bool open]) { |
| 666 if (?open) { | 605 if (?open) { |
| 667 var bound_1 = _convertDartToNative_IDBKey(bound); | 606 var bound_1 = _convertDartToNative_IDBKey(bound); |
| 668 return _upperBound__1(bound_1, open); | 607 return _upperBound__1(bound_1, open); |
| 669 } | 608 } |
| 670 var bound_2 = _convertDartToNative_IDBKey(bound); | 609 var bound_2 = _convertDartToNative_IDBKey(bound); |
| 671 return _upperBound__2(bound_2); | 610 return _upperBound__2(bound_2); |
| 672 } | 611 } |
| 673 @JSName('upperBound') | 612 @JSName('upperBound') |
| 674 @DocsEditable | 613 @DocsEditable @DomName('IDBKeyRange.upperBound') |
| 675 @DomName('IDBKeyRange.upperBound') | |
| 676 static KeyRange _upperBound__1(bound, open) native; | 614 static KeyRange _upperBound__1(bound, open) native; |
| 677 @JSName('upperBound') | 615 @JSName('upperBound') |
| 678 @DocsEditable | 616 @DocsEditable @DomName('IDBKeyRange.upperBound') |
| 679 @DomName('IDBKeyRange.upperBound') | |
| 680 static KeyRange _upperBound__2(bound) native; | 617 static KeyRange _upperBound__2(bound) native; |
| 681 | 618 |
| 682 } | 619 } |
| 683 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 620 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 684 // for details. All rights reserved. Use of this source code is governed by a | 621 // for details. All rights reserved. Use of this source code is governed by a |
| 685 // BSD-style license that can be found in the LICENSE file. | 622 // BSD-style license that can be found in the LICENSE file. |
| 686 | 623 |
| 687 | 624 |
| 688 | 625 |
| 689 @DocsEditable | 626 @DocsEditable |
| 690 @DomName('IDBObjectStore') | 627 @DomName('IDBObjectStore') |
| 691 class ObjectStore native "*IDBObjectStore" { | 628 class ObjectStore native "*IDBObjectStore" { |
| 692 | 629 |
| 693 @DocsEditable | 630 @DocsEditable @DomName('IDBObjectStore.autoIncrement') |
| 694 @DomName('IDBObjectStore.autoIncrement') | |
| 695 final bool autoIncrement; | 631 final bool autoIncrement; |
| 696 | 632 |
| 697 @DocsEditable | 633 @DocsEditable @DomName('IDBObjectStore.indexNames') |
| 698 @DomName('IDBObjectStore.indexNames') | 634 @Returns('DomStringList') @Creates('DomStringList') |
| 699 @Returns('DomStringList') | |
| 700 @Creates('DomStringList') | |
| 701 final List<String> indexNames; | 635 final List<String> indexNames; |
| 702 | 636 |
| 703 @DocsEditable | 637 @DocsEditable @DomName('IDBObjectStore.keyPath') |
| 704 @DomName('IDBObjectStore.keyPath') | |
| 705 final dynamic keyPath; | 638 final dynamic keyPath; |
| 706 | 639 |
| 707 @DocsEditable | 640 @DocsEditable @DomName('IDBObjectStore.name') |
| 708 @DomName('IDBObjectStore.name') | |
| 709 final String name; | 641 final String name; |
| 710 | 642 |
| 711 @DocsEditable | 643 @DocsEditable @DomName('IDBObjectStore.transaction') |
| 712 @DomName('IDBObjectStore.transaction') | |
| 713 final Transaction transaction; | 644 final Transaction transaction; |
| 714 | 645 |
| 715 Request add(/*any*/ value, [/*IDBKey*/ key]) { | 646 Request add(/*any*/ value, [/*IDBKey*/ key]) { |
| 716 if (?key) { | 647 if (?key) { |
| 717 var value_1 = convertDartToNative_SerializedScriptValue(value); | 648 var value_1 = convertDartToNative_SerializedScriptValue(value); |
| 718 var key_2 = _convertDartToNative_IDBKey(key); | 649 var key_2 = _convertDartToNative_IDBKey(key); |
| 719 return _add_1(value_1, key_2); | 650 return _add_1(value_1, key_2); |
| 720 } | 651 } |
| 721 var value_3 = convertDartToNative_SerializedScriptValue(value); | 652 var value_3 = convertDartToNative_SerializedScriptValue(value); |
| 722 return _add_2(value_3); | 653 return _add_2(value_3); |
| 723 } | 654 } |
| 724 @JSName('add') | 655 @JSName('add') |
| 725 @DocsEditable | 656 @DocsEditable @DomName('IDBObjectStore.add') @Returns('Request') @Creates('Req
uest') @_annotation_Creates_IDBKey |
| 726 @DomName('IDBObjectStore.add') | |
| 727 Request _add_1(value, key) native; | 657 Request _add_1(value, key) native; |
| 728 @JSName('add') | 658 @JSName('add') |
| 729 @DocsEditable | 659 @DocsEditable @DomName('IDBObjectStore.add') @Returns('Request') @Creates('Req
uest') @_annotation_Creates_IDBKey |
| 730 @DomName('IDBObjectStore.add') | |
| 731 Request _add_2(value) native; | 660 Request _add_2(value) native; |
| 732 | 661 |
| 733 @DocsEditable | 662 @DocsEditable @DomName('IDBObjectStore.clear') |
| 734 @DomName('IDBObjectStore.clear') | |
| 735 Request clear() native; | 663 Request clear() native; |
| 736 | 664 |
| 737 Request count([key_OR_range]) { | 665 Request count([key_OR_range]) { |
| 738 if (!?key_OR_range) { | 666 if (!?key_OR_range) { |
| 739 return _count_1(); | 667 return _count_1(); |
| 740 } | 668 } |
| 741 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 669 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 742 return _count_2(key_OR_range); | 670 return _count_2(key_OR_range); |
| 743 } | 671 } |
| 744 if (?key_OR_range) { | 672 if (?key_OR_range) { |
| 745 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | 673 var key_1 = _convertDartToNative_IDBKey(key_OR_range); |
| 746 return _count_3(key_1); | 674 return _count_3(key_1); |
| 747 } | 675 } |
| 748 throw new ArgumentError("Incorrect number or type of arguments"); | 676 throw new ArgumentError("Incorrect number or type of arguments"); |
| 749 } | 677 } |
| 750 @JSName('count') | 678 @JSName('count') |
| 751 @DocsEditable | 679 @DocsEditable @DomName('IDBObjectStore.count') |
| 752 @DomName('IDBObjectStore.count') | |
| 753 Request _count_1() native; | 680 Request _count_1() native; |
| 754 @JSName('count') | 681 @JSName('count') |
| 755 @DocsEditable | 682 @DocsEditable @DomName('IDBObjectStore.count') |
| 756 @DomName('IDBObjectStore.count') | |
| 757 Request _count_2(KeyRange range) native; | 683 Request _count_2(KeyRange range) native; |
| 758 @JSName('count') | 684 @JSName('count') |
| 759 @DocsEditable | 685 @DocsEditable @DomName('IDBObjectStore.count') |
| 760 @DomName('IDBObjectStore.count') | |
| 761 Request _count_3(key) native; | 686 Request _count_3(key) native; |
| 762 | 687 |
| 763 Index createIndex(String name, keyPath, [Map options]) { | 688 Index createIndex(String name, keyPath, [Map options]) { |
| 764 if ((keyPath is List<String> || keyPath == null) && | 689 if ((keyPath is List<String> || keyPath == null) && |
| 765 !?options) { | 690 !?options) { |
| 766 return _createIndex_1(name, keyPath); | 691 return _createIndex_1(name, keyPath); |
| 767 } | 692 } |
| 768 if ((keyPath is List<String> || keyPath == null)) { | 693 if ((keyPath is List<String> || keyPath == null)) { |
| 769 var options_1 = convertDartToNative_Dictionary(options); | 694 var options_1 = convertDartToNative_Dictionary(options); |
| 770 return _createIndex_2(name, keyPath, options_1); | 695 return _createIndex_2(name, keyPath, options_1); |
| 771 } | 696 } |
| 772 if ((keyPath is String || keyPath == null) && | 697 if ((keyPath is String || keyPath == null) && |
| 773 !?options) { | 698 !?options) { |
| 774 return _createIndex_3(name, keyPath); | 699 return _createIndex_3(name, keyPath); |
| 775 } | 700 } |
| 776 if ((keyPath is String || keyPath == null)) { | 701 if ((keyPath is String || keyPath == null)) { |
| 777 var options_2 = convertDartToNative_Dictionary(options); | 702 var options_2 = convertDartToNative_Dictionary(options); |
| 778 return _createIndex_4(name, keyPath, options_2); | 703 return _createIndex_4(name, keyPath, options_2); |
| 779 } | 704 } |
| 780 throw new ArgumentError("Incorrect number or type of arguments"); | 705 throw new ArgumentError("Incorrect number or type of arguments"); |
| 781 } | 706 } |
| 782 @JSName('createIndex') | 707 @JSName('createIndex') |
| 783 @DocsEditable | 708 @DocsEditable @DomName('IDBObjectStore.createIndex') |
| 784 @DomName('IDBObjectStore.createIndex') | |
| 785 Index _createIndex_1(name, List<String> keyPath) native; | 709 Index _createIndex_1(name, List<String> keyPath) native; |
| 786 @JSName('createIndex') | 710 @JSName('createIndex') |
| 787 @DocsEditable | 711 @DocsEditable @DomName('IDBObjectStore.createIndex') |
| 788 @DomName('IDBObjectStore.createIndex') | |
| 789 Index _createIndex_2(name, List<String> keyPath, options) native; | 712 Index _createIndex_2(name, List<String> keyPath, options) native; |
| 790 @JSName('createIndex') | 713 @JSName('createIndex') |
| 791 @DocsEditable | 714 @DocsEditable @DomName('IDBObjectStore.createIndex') |
| 792 @DomName('IDBObjectStore.createIndex') | |
| 793 Index _createIndex_3(name, String keyPath) native; | 715 Index _createIndex_3(name, String keyPath) native; |
| 794 @JSName('createIndex') | 716 @JSName('createIndex') |
| 795 @DocsEditable | 717 @DocsEditable @DomName('IDBObjectStore.createIndex') |
| 796 @DomName('IDBObjectStore.createIndex') | |
| 797 Index _createIndex_4(name, String keyPath, options) native; | 718 Index _createIndex_4(name, String keyPath, options) native; |
| 798 | 719 |
| 799 Request delete(key_OR_keyRange) { | 720 Request delete(key_OR_keyRange) { |
| 800 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { | 721 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { |
| 801 return _delete_1(key_OR_keyRange); | 722 return _delete_1(key_OR_keyRange); |
| 802 } | 723 } |
| 803 if (?key_OR_keyRange) { | 724 if (?key_OR_keyRange) { |
| 804 var key_1 = _convertDartToNative_IDBKey(key_OR_keyRange); | 725 var key_1 = _convertDartToNative_IDBKey(key_OR_keyRange); |
| 805 return _delete_2(key_1); | 726 return _delete_2(key_1); |
| 806 } | 727 } |
| 807 throw new ArgumentError("Incorrect number or type of arguments"); | 728 throw new ArgumentError("Incorrect number or type of arguments"); |
| 808 } | 729 } |
| 809 @JSName('delete') | 730 @JSName('delete') |
| 810 @DocsEditable | 731 @DocsEditable @DomName('IDBObjectStore.delete') |
| 811 @DomName('IDBObjectStore.delete') | |
| 812 Request _delete_1(KeyRange keyRange) native; | 732 Request _delete_1(KeyRange keyRange) native; |
| 813 @JSName('delete') | 733 @JSName('delete') |
| 814 @DocsEditable | 734 @DocsEditable @DomName('IDBObjectStore.delete') |
| 815 @DomName('IDBObjectStore.delete') | |
| 816 Request _delete_2(key) native; | 735 Request _delete_2(key) native; |
| 817 | 736 |
| 818 @DocsEditable | 737 @DocsEditable @DomName('IDBObjectStore.deleteIndex') |
| 819 @DomName('IDBObjectStore.deleteIndex') | |
| 820 void deleteIndex(String name) native; | 738 void deleteIndex(String name) native; |
| 821 | 739 |
| 822 Request getObject(key) { | 740 Request getObject(key) { |
| 823 if ((key is KeyRange || key == null)) { | 741 if ((key is KeyRange || key == null)) { |
| 824 return _getObject_1(key); | 742 return _getObject_1(key); |
| 825 } | 743 } |
| 826 if (?key) { | 744 if (?key) { |
| 827 var key_1 = _convertDartToNative_IDBKey(key); | 745 var key_1 = _convertDartToNative_IDBKey(key); |
| 828 return _getObject_2(key_1); | 746 return _getObject_2(key_1); |
| 829 } | 747 } |
| 830 throw new ArgumentError("Incorrect number or type of arguments"); | 748 throw new ArgumentError("Incorrect number or type of arguments"); |
| 831 } | 749 } |
| 832 @JSName('get') | 750 @JSName('get') |
| 833 @DocsEditable | 751 @DocsEditable @DomName('IDBObjectStore.get') @Returns('Request') @Creates('Req
uest') @annotation_Creates_SerializedScriptValue |
| 834 @DomName('IDBObjectStore.get') | |
| 835 Request _getObject_1(KeyRange key) native; | 752 Request _getObject_1(KeyRange key) native; |
| 836 @JSName('get') | 753 @JSName('get') |
| 837 @DocsEditable | 754 @DocsEditable @DomName('IDBObjectStore.get') @Returns('Request') @Creates('Req
uest') @annotation_Creates_SerializedScriptValue |
| 838 @DomName('IDBObjectStore.get') | |
| 839 Request _getObject_2(key) native; | 755 Request _getObject_2(key) native; |
| 840 | 756 |
| 841 @DocsEditable | 757 @DocsEditable @DomName('IDBObjectStore.index') |
| 842 @DomName('IDBObjectStore.index') | |
| 843 Index index(String name) native; | 758 Index index(String name) native; |
| 844 | 759 |
| 845 Request openCursor([key_OR_range, String direction]) { | 760 Request openCursor([key_OR_range, String direction]) { |
| 846 if (!?key_OR_range && | 761 if (!?key_OR_range && |
| 847 !?direction) { | 762 !?direction) { |
| 848 return _openCursor_1(); | 763 return _openCursor_1(); |
| 849 } | 764 } |
| 850 if ((key_OR_range is KeyRange || key_OR_range == null) && | 765 if ((key_OR_range is KeyRange || key_OR_range == null) && |
| 851 !?direction) { | 766 !?direction) { |
| 852 return _openCursor_2(key_OR_range); | 767 return _openCursor_2(key_OR_range); |
| 853 } | 768 } |
| 854 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 769 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 855 return _openCursor_3(key_OR_range, direction); | 770 return _openCursor_3(key_OR_range, direction); |
| 856 } | 771 } |
| 857 if (?key_OR_range && | 772 if (?key_OR_range && |
| 858 !?direction) { | 773 !?direction) { |
| 859 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | 774 var key_1 = _convertDartToNative_IDBKey(key_OR_range); |
| 860 return _openCursor_4(key_1); | 775 return _openCursor_4(key_1); |
| 861 } | 776 } |
| 862 if (?key_OR_range) { | 777 if (?key_OR_range) { |
| 863 var key_2 = _convertDartToNative_IDBKey(key_OR_range); | 778 var key_2 = _convertDartToNative_IDBKey(key_OR_range); |
| 864 return _openCursor_5(key_2, direction); | 779 return _openCursor_5(key_2, direction); |
| 865 } | 780 } |
| 866 throw new ArgumentError("Incorrect number or type of arguments"); | 781 throw new ArgumentError("Incorrect number or type of arguments"); |
| 867 } | 782 } |
| 868 @JSName('openCursor') | 783 @JSName('openCursor') |
| 869 @DocsEditable | 784 @DocsEditable @DomName('IDBObjectStore.openCursor') @Returns('Request') @Creat
es('Request') @Creates('Cursor') |
| 870 @DomName('IDBObjectStore.openCursor') | |
| 871 Request _openCursor_1() native; | 785 Request _openCursor_1() native; |
| 872 @JSName('openCursor') | 786 @JSName('openCursor') |
| 873 @DocsEditable | 787 @DocsEditable @DomName('IDBObjectStore.openCursor') @Returns('Request') @Creat
es('Request') @Creates('Cursor') |
| 874 @DomName('IDBObjectStore.openCursor') | |
| 875 Request _openCursor_2(KeyRange range) native; | 788 Request _openCursor_2(KeyRange range) native; |
| 876 @JSName('openCursor') | 789 @JSName('openCursor') |
| 877 @DocsEditable | 790 @DocsEditable @DomName('IDBObjectStore.openCursor') @Returns('Request') @Creat
es('Request') @Creates('Cursor') |
| 878 @DomName('IDBObjectStore.openCursor') | |
| 879 Request _openCursor_3(KeyRange range, direction) native; | 791 Request _openCursor_3(KeyRange range, direction) native; |
| 880 @JSName('openCursor') | 792 @JSName('openCursor') |
| 881 @DocsEditable | 793 @DocsEditable @DomName('IDBObjectStore.openCursor') @Returns('Request') @Creat
es('Request') @Creates('Cursor') |
| 882 @DomName('IDBObjectStore.openCursor') | |
| 883 Request _openCursor_4(key) native; | 794 Request _openCursor_4(key) native; |
| 884 @JSName('openCursor') | 795 @JSName('openCursor') |
| 885 @DocsEditable | 796 @DocsEditable @DomName('IDBObjectStore.openCursor') @Returns('Request') @Creat
es('Request') @Creates('Cursor') |
| 886 @DomName('IDBObjectStore.openCursor') | |
| 887 Request _openCursor_5(key, direction) native; | 797 Request _openCursor_5(key, direction) native; |
| 888 | 798 |
| 889 Request put(/*any*/ value, [/*IDBKey*/ key]) { | 799 Request put(/*any*/ value, [/*IDBKey*/ key]) { |
| 890 if (?key) { | 800 if (?key) { |
| 891 var value_1 = convertDartToNative_SerializedScriptValue(value); | 801 var value_1 = convertDartToNative_SerializedScriptValue(value); |
| 892 var key_2 = _convertDartToNative_IDBKey(key); | 802 var key_2 = _convertDartToNative_IDBKey(key); |
| 893 return _put_1(value_1, key_2); | 803 return _put_1(value_1, key_2); |
| 894 } | 804 } |
| 895 var value_3 = convertDartToNative_SerializedScriptValue(value); | 805 var value_3 = convertDartToNative_SerializedScriptValue(value); |
| 896 return _put_2(value_3); | 806 return _put_2(value_3); |
| 897 } | 807 } |
| 898 @JSName('put') | 808 @JSName('put') |
| 899 @DocsEditable | 809 @DocsEditable @DomName('IDBObjectStore.put') @Returns('Request') @Creates('Req
uest') @_annotation_Creates_IDBKey |
| 900 @DomName('IDBObjectStore.put') | |
| 901 Request _put_1(value, key) native; | 810 Request _put_1(value, key) native; |
| 902 @JSName('put') | 811 @JSName('put') |
| 903 @DocsEditable | 812 @DocsEditable @DomName('IDBObjectStore.put') @Returns('Request') @Creates('Req
uest') @_annotation_Creates_IDBKey |
| 904 @DomName('IDBObjectStore.put') | |
| 905 Request _put_2(value) native; | 813 Request _put_2(value) native; |
| 906 } | 814 } |
| 907 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 815 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 908 // for details. All rights reserved. Use of this source code is governed by a | 816 // for details. All rights reserved. Use of this source code is governed by a |
| 909 // BSD-style license that can be found in the LICENSE file. | 817 // BSD-style license that can be found in the LICENSE file. |
| 910 | 818 |
| 911 | 819 |
| 912 | 820 |
| 913 @DocsEditable | 821 @DocsEditable |
| 914 @DomName('IDBOpenDBRequest') | 822 @DomName('IDBOpenDBRequest') |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 859 |
| 952 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 860 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 953 | 861 |
| 954 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); | 862 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); |
| 955 | 863 |
| 956 @DocsEditable | 864 @DocsEditable |
| 957 @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, Event
Target.dispatchEvent') | 865 @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, Event
Target.dispatchEvent') |
| 958 RequestEvents get on => | 866 RequestEvents get on => |
| 959 new RequestEvents(this); | 867 new RequestEvents(this); |
| 960 | 868 |
| 961 @DocsEditable | 869 @DocsEditable @DomName('IDBRequest.error') |
| 962 @DomName('IDBRequest.error') | |
| 963 final DomError error; | 870 final DomError error; |
| 964 | 871 |
| 965 @DocsEditable | 872 @DocsEditable @DomName('IDBRequest.readyState') |
| 966 @DomName('IDBRequest.readyState') | |
| 967 final String readyState; | 873 final String readyState; |
| 968 | 874 |
| 969 dynamic get result => _convertNativeToDart_IDBAny(this._result); | 875 dynamic get result => _convertNativeToDart_IDBAny(this._result); |
| 970 @JSName('result') | 876 @JSName('result') |
| 971 @DocsEditable | 877 @DocsEditable @DomName('IDBRequest.result') @Creates('Null') |
| 972 @DomName('IDBRequest.result') | |
| 973 @Creates('Null') | |
| 974 final dynamic _result; | 878 final dynamic _result; |
| 975 | 879 |
| 976 @DocsEditable | 880 @DocsEditable @DomName('IDBRequest.source') @Creates('Null') |
| 977 @DomName('IDBRequest.source') | |
| 978 @Creates('Null') | |
| 979 final dynamic source; | 881 final dynamic source; |
| 980 | 882 |
| 981 @DocsEditable | 883 @DocsEditable @DomName('IDBRequest.transaction') |
| 982 @DomName('IDBRequest.transaction') | |
| 983 final Transaction transaction; | 884 final Transaction transaction; |
| 984 | 885 |
| 985 @DocsEditable | 886 @DocsEditable @DomName('IDBRequest.webkitErrorMessage') |
| 986 @DomName('IDBRequest.webkitErrorMessage') | |
| 987 final String webkitErrorMessage; | 887 final String webkitErrorMessage; |
| 988 | 888 |
| 989 @JSName('addEventListener') | 889 @JSName('addEventListener') |
| 990 @DocsEditable | 890 @DocsEditable @DomName('IDBRequest.addEventListener') |
| 991 @DomName('IDBRequest.addEventListener') | |
| 992 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | 891 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 993 | 892 |
| 994 @JSName('dispatchEvent') | 893 @JSName('dispatchEvent') |
| 995 @DocsEditable | 894 @DocsEditable @DomName('IDBRequest.dispatchEvent') |
| 996 @DomName('IDBRequest.dispatchEvent') | |
| 997 bool $dom_dispatchEvent(Event evt) native; | 895 bool $dom_dispatchEvent(Event evt) native; |
| 998 | 896 |
| 999 @JSName('removeEventListener') | 897 @JSName('removeEventListener') |
| 1000 @DocsEditable | 898 @DocsEditable @DomName('IDBRequest.removeEventListener') |
| 1001 @DomName('IDBRequest.removeEventListener') | |
| 1002 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 899 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 1003 | 900 |
| 1004 Stream<Event> get onError => errorEvent.forTarget(this); | 901 Stream<Event> get onError => errorEvent.forTarget(this); |
| 1005 | 902 |
| 1006 Stream<Event> get onSuccess => successEvent.forTarget(this); | 903 Stream<Event> get onSuccess => successEvent.forTarget(this); |
| 1007 } | 904 } |
| 1008 | 905 |
| 1009 @DocsEditable | 906 @DocsEditable |
| 1010 class RequestEvents extends Events { | 907 class RequestEvents extends Events { |
| 1011 @DocsEditable | 908 @DocsEditable |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1031 | 928 |
| 1032 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); | 929 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); |
| 1033 | 930 |
| 1034 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 931 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 1035 | 932 |
| 1036 @DocsEditable | 933 @DocsEditable |
| 1037 @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, Event
Target.dispatchEvent') | 934 @DomName('EventTarget.addEventListener, EventTarget.removeEventListener, Event
Target.dispatchEvent') |
| 1038 TransactionEvents get on => | 935 TransactionEvents get on => |
| 1039 new TransactionEvents(this); | 936 new TransactionEvents(this); |
| 1040 | 937 |
| 1041 @DocsEditable | 938 @DocsEditable @DomName('IDBTransaction.db') |
| 1042 @DomName('IDBTransaction.db') | |
| 1043 final Database db; | 939 final Database db; |
| 1044 | 940 |
| 1045 @DocsEditable | 941 @DocsEditable @DomName('IDBTransaction.error') |
| 1046 @DomName('IDBTransaction.error') | |
| 1047 final DomError error; | 942 final DomError error; |
| 1048 | 943 |
| 1049 @DocsEditable | 944 @DocsEditable @DomName('IDBTransaction.mode') |
| 1050 @DomName('IDBTransaction.mode') | |
| 1051 final String mode; | 945 final String mode; |
| 1052 | 946 |
| 1053 @DocsEditable | 947 @DocsEditable @DomName('IDBTransaction.webkitErrorMessage') |
| 1054 @DomName('IDBTransaction.webkitErrorMessage') | |
| 1055 final String webkitErrorMessage; | 948 final String webkitErrorMessage; |
| 1056 | 949 |
| 1057 @DocsEditable | 950 @DocsEditable @DomName('IDBTransaction.abort') |
| 1058 @DomName('IDBTransaction.abort') | |
| 1059 void abort() native; | 951 void abort() native; |
| 1060 | 952 |
| 1061 @JSName('addEventListener') | 953 @JSName('addEventListener') |
| 1062 @DocsEditable | 954 @DocsEditable @DomName('IDBTransaction.addEventListener') |
| 1063 @DomName('IDBTransaction.addEventListener') | |
| 1064 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | 955 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 1065 | 956 |
| 1066 @JSName('dispatchEvent') | 957 @JSName('dispatchEvent') |
| 1067 @DocsEditable | 958 @DocsEditable @DomName('IDBTransaction.dispatchEvent') |
| 1068 @DomName('IDBTransaction.dispatchEvent') | |
| 1069 bool $dom_dispatchEvent(Event evt) native; | 959 bool $dom_dispatchEvent(Event evt) native; |
| 1070 | 960 |
| 1071 @DocsEditable | 961 @DocsEditable @DomName('IDBTransaction.objectStore') |
| 1072 @DomName('IDBTransaction.objectStore') | |
| 1073 ObjectStore objectStore(String name) native; | 962 ObjectStore objectStore(String name) native; |
| 1074 | 963 |
| 1075 @JSName('removeEventListener') | 964 @JSName('removeEventListener') |
| 1076 @DocsEditable | 965 @DocsEditable @DomName('IDBTransaction.removeEventListener') |
| 1077 @DomName('IDBTransaction.removeEventListener') | |
| 1078 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | 966 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; |
| 1079 | 967 |
| 1080 Stream<Event> get onAbort => abortEvent.forTarget(this); | 968 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 1081 | 969 |
| 1082 Stream<Event> get onComplete => completeEvent.forTarget(this); | 970 Stream<Event> get onComplete => completeEvent.forTarget(this); |
| 1083 | 971 |
| 1084 Stream<Event> get onError => errorEvent.forTarget(this); | 972 Stream<Event> get onError => errorEvent.forTarget(this); |
| 1085 } | 973 } |
| 1086 | 974 |
| 1087 @DocsEditable | 975 @DocsEditable |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1101 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 989 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1102 // for details. All rights reserved. Use of this source code is governed by a | 990 // for details. All rights reserved. Use of this source code is governed by a |
| 1103 // BSD-style license that can be found in the LICENSE file. | 991 // BSD-style license that can be found in the LICENSE file. |
| 1104 | 992 |
| 1105 | 993 |
| 1106 | 994 |
| 1107 @DocsEditable | 995 @DocsEditable |
| 1108 @DomName('IDBVersionChangeEvent') | 996 @DomName('IDBVersionChangeEvent') |
| 1109 class UpgradeNeededEvent extends Event native "*IDBVersionChangeEvent" { | 997 class UpgradeNeededEvent extends Event native "*IDBVersionChangeEvent" { |
| 1110 | 998 |
| 1111 @DocsEditable | 999 @DocsEditable @DomName('IDBUpgradeNeededEvent.newVersion') |
| 1112 @DomName('IDBUpgradeNeededEvent.newVersion') | |
| 1113 final int newVersion; | 1000 final int newVersion; |
| 1114 | 1001 |
| 1115 @DocsEditable | 1002 @DocsEditable @DomName('IDBUpgradeNeededEvent.oldVersion') |
| 1116 @DomName('IDBUpgradeNeededEvent.oldVersion') | |
| 1117 final int oldVersion; | 1003 final int oldVersion; |
| 1118 } | 1004 } |
| 1119 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1005 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1120 // for details. All rights reserved. Use of this source code is governed by a | 1006 // for details. All rights reserved. Use of this source code is governed by a |
| 1121 // BSD-style license that can be found in the LICENSE file. | 1007 // BSD-style license that can be found in the LICENSE file. |
| 1122 | 1008 |
| 1123 | 1009 |
| 1124 | 1010 |
| 1125 @DocsEditable | 1011 @DocsEditable |
| 1126 @DomName('IDBVersionChangeEvent') | 1012 @DomName('IDBVersionChangeEvent') |
| 1127 class VersionChangeEvent extends Event native "*IDBVersionChangeEvent" { | 1013 class VersionChangeEvent extends Event native "*IDBVersionChangeEvent" { |
| 1128 | 1014 |
| 1129 @DocsEditable | 1015 @DocsEditable @DomName('IDBVersionChangeEvent.version') |
| 1130 @DomName('IDBVersionChangeEvent.version') | |
| 1131 final String version; | 1016 final String version; |
| 1132 } | 1017 } |
| 1133 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1018 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1134 // for details. All rights reserved. Use of this source code is governed by a | 1019 // for details. All rights reserved. Use of this source code is governed by a |
| 1135 // BSD-style license that can be found in the LICENSE file. | 1020 // BSD-style license that can be found in the LICENSE file. |
| 1136 | 1021 |
| 1137 | 1022 |
| 1138 | 1023 |
| 1139 @DocsEditable | 1024 @DocsEditable |
| 1140 @DomName('IDBVersionChangeRequest') | 1025 @DomName('IDBVersionChangeRequest') |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1161 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1046 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1162 // for details. All rights reserved. Use of this source code is governed by a | 1047 // for details. All rights reserved. Use of this source code is governed by a |
| 1163 // BSD-style license that can be found in the LICENSE file. | 1048 // BSD-style license that can be found in the LICENSE file. |
| 1164 | 1049 |
| 1165 | 1050 |
| 1166 | 1051 |
| 1167 @DocsEditable | 1052 @DocsEditable |
| 1168 @DomName('IDBAny') | 1053 @DomName('IDBAny') |
| 1169 class _Any native "*IDBAny" { | 1054 class _Any native "*IDBAny" { |
| 1170 } | 1055 } |
| OLD | NEW |