OLD | NEW |
(Empty) | |
| 1 library indexed_db; |
| 2 |
| 3 import 'dart:html'; |
| 4 import 'dart:html_common'; |
| 5 import 'dart:nativewrappers'; |
| 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 |
| 8 // BSD-style license that can be found in the LICENSE file. |
| 9 |
| 10 // DO NOT EDIT |
| 11 // Auto-generated dart:indexed_db library. |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 class _KeyRangeFactoryProvider { |
| 18 |
| 19 static KeyRange createKeyRange_only(/*IDBKey*/ value) => |
| 20 KeyRange.only_(value); |
| 21 |
| 22 static KeyRange createKeyRange_lowerBound( |
| 23 /*IDBKey*/ bound, [bool open = false]) => |
| 24 KeyRange.lowerBound_(bound, open); |
| 25 |
| 26 static KeyRange createKeyRange_upperBound( |
| 27 /*IDBKey*/ bound, [bool open = false]) => |
| 28 KeyRange.upperBound_(bound, open); |
| 29 |
| 30 static KeyRange createKeyRange_bound( |
| 31 /*IDBKey*/ lower, /*IDBKey*/ upper, |
| 32 [bool lowerOpen = false, bool upperOpen = false]) => |
| 33 KeyRange.bound_(lower, upper, lowerOpen, upperOpen); |
| 34 } |
| 35 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 36 // for details. All rights reserved. Use of this source code is governed by a |
| 37 // BSD-style license that can be found in the LICENSE file. |
| 38 |
| 39 // WARNING: Do not edit - generated code. |
| 40 |
| 41 |
| 42 /// @domName IDBAny |
| 43 class Any extends NativeFieldWrapperClass1 { |
| 44 Any.internal(); |
| 45 |
| 46 } |
| 47 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 48 // for details. All rights reserved. Use of this source code is governed by a |
| 49 // BSD-style license that can be found in the LICENSE file. |
| 50 |
| 51 // WARNING: Do not edit - generated code. |
| 52 |
| 53 |
| 54 /// @domName IDBCursor |
| 55 class Cursor extends NativeFieldWrapperClass1 { |
| 56 Cursor.internal(); |
| 57 |
| 58 static const int NEXT = 0; |
| 59 |
| 60 static const int NEXT_NO_DUPLICATE = 1; |
| 61 |
| 62 static const int PREV = 2; |
| 63 |
| 64 static const int PREV_NO_DUPLICATE = 3; |
| 65 |
| 66 |
| 67 /** @domName IDBCursor.direction */ |
| 68 String get direction native "IDBCursor_direction_Getter"; |
| 69 |
| 70 |
| 71 /** @domName IDBCursor.key */ |
| 72 Object get key native "IDBCursor_key_Getter"; |
| 73 |
| 74 |
| 75 /** @domName IDBCursor.primaryKey */ |
| 76 Object get primaryKey native "IDBCursor_primaryKey_Getter"; |
| 77 |
| 78 |
| 79 /** @domName IDBCursor.source */ |
| 80 dynamic get source native "IDBCursor_source_Getter"; |
| 81 |
| 82 |
| 83 /** @domName IDBCursor.advance */ |
| 84 void advance(int count) native "IDBCursor_advance_Callback"; |
| 85 |
| 86 void continueFunction([/*IDBKey*/ key]) { |
| 87 if (?key) { |
| 88 _continue_1(key); |
| 89 return; |
| 90 } |
| 91 _continue_2(); |
| 92 } |
| 93 |
| 94 |
| 95 /** @domName IDBCursor.continue_1 */ |
| 96 void _continue_1(key) native "IDBCursor_continue_1_Callback"; |
| 97 |
| 98 |
| 99 /** @domName IDBCursor.continue_2 */ |
| 100 void _continue_2() native "IDBCursor_continue_2_Callback"; |
| 101 |
| 102 |
| 103 /** @domName IDBCursor.delete */ |
| 104 Request delete() native "IDBCursor_delete_Callback"; |
| 105 |
| 106 |
| 107 /** @domName IDBCursor.update */ |
| 108 Request update(Object value) native "IDBCursor_update_Callback"; |
| 109 |
| 110 } |
| 111 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 112 // for details. All rights reserved. Use of this source code is governed by a |
| 113 // BSD-style license that can be found in the LICENSE file. |
| 114 |
| 115 // WARNING: Do not edit - generated code. |
| 116 |
| 117 |
| 118 /// @domName IDBCursorWithValue |
| 119 class CursorWithValue extends Cursor { |
| 120 CursorWithValue.internal(): super.internal(); |
| 121 |
| 122 |
| 123 /** @domName IDBCursorWithValue.value */ |
| 124 Object get value native "IDBCursorWithValue_value_Getter"; |
| 125 |
| 126 } |
| 127 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 128 // for details. All rights reserved. Use of this source code is governed by a |
| 129 // BSD-style license that can be found in the LICENSE file. |
| 130 |
| 131 // WARNING: Do not edit - generated code. |
| 132 |
| 133 |
| 134 /// @domName IDBDatabase |
| 135 class Database extends EventTarget { |
| 136 Database.internal(): super.internal(); |
| 137 |
| 138 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 139 DatabaseEvents get on => |
| 140 new DatabaseEvents(this); |
| 141 |
| 142 |
| 143 /** @domName IDBDatabase.name */ |
| 144 String get name native "IDBDatabase_name_Getter"; |
| 145 |
| 146 |
| 147 /** @domName IDBDatabase.objectStoreNames */ |
| 148 List<String> get objectStoreNames native "IDBDatabase_objectStoreNames_Getter"
; |
| 149 |
| 150 |
| 151 /** @domName IDBDatabase.version */ |
| 152 dynamic get version native "IDBDatabase_version_Getter"; |
| 153 |
| 154 |
| 155 /** @domName IDBDatabase.addEventListener */ |
| 156 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBDatabase_addEventListener_Callback"; |
| 157 |
| 158 |
| 159 /** @domName IDBDatabase.close */ |
| 160 void close() native "IDBDatabase_close_Callback"; |
| 161 |
| 162 |
| 163 /** @domName IDBDatabase.createObjectStore */ |
| 164 ObjectStore createObjectStore(String name, [Map options]) native "IDBDatabase_
createObjectStore_Callback"; |
| 165 |
| 166 |
| 167 /** @domName IDBDatabase.deleteObjectStore */ |
| 168 void deleteObjectStore(String name) native "IDBDatabase_deleteObjectStore_Call
back"; |
| 169 |
| 170 |
| 171 /** @domName IDBDatabase.dispatchEvent */ |
| 172 bool $dom_dispatchEvent(Event evt) native "IDBDatabase_dispatchEvent_Callback"
; |
| 173 |
| 174 |
| 175 /** @domName IDBDatabase.removeEventListener */ |
| 176 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBDatabase_removeEventListener_Callback"; |
| 177 |
| 178 |
| 179 /** @domName IDBDatabase.setVersion */ |
| 180 VersionChangeRequest setVersion(String version) native "IDBDatabase_setVersion
_Callback"; |
| 181 |
| 182 Transaction transaction(storeName_OR_storeNames, /*DOMString*/ mode) { |
| 183 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && (mode is String || mode == null)) { |
| 184 return _transaction_1(storeName_OR_storeNames, mode); |
| 185 } |
| 186 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && (mode is String || mode == null)) { |
| 187 return _transaction_2(storeName_OR_storeNames, mode); |
| 188 } |
| 189 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) &
& (mode is String || mode == null)) { |
| 190 return _transaction_3(storeName_OR_storeNames, mode); |
| 191 } |
| 192 throw "Incorrect number or type of arguments"; |
| 193 } |
| 194 |
| 195 |
| 196 /** @domName IDBDatabase.transaction_1 */ |
| 197 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
transaction_1_Callback"; |
| 198 |
| 199 |
| 200 /** @domName IDBDatabase.transaction_2 */ |
| 201 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
transaction_2_Callback"; |
| 202 |
| 203 |
| 204 /** @domName IDBDatabase.transaction_3 */ |
| 205 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
transaction_3_Callback"; |
| 206 |
| 207 } |
| 208 |
| 209 class DatabaseEvents extends Events { |
| 210 DatabaseEvents(EventTarget _ptr) : super(_ptr); |
| 211 |
| 212 EventListenerList get abort => this['abort']; |
| 213 |
| 214 EventListenerList get error => this['error']; |
| 215 |
| 216 EventListenerList get versionChange => this['versionchange']; |
| 217 } |
| 218 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 219 // for details. All rights reserved. Use of this source code is governed by a |
| 220 // BSD-style license that can be found in the LICENSE file. |
| 221 |
| 222 // WARNING: Do not edit - generated code. |
| 223 |
| 224 |
| 225 /// @domName IDBDatabaseException |
| 226 class DatabaseException extends NativeFieldWrapperClass1 { |
| 227 DatabaseException.internal(); |
| 228 |
| 229 static const int ABORT_ERR = 20; |
| 230 |
| 231 static const int CONSTRAINT_ERR = 4; |
| 232 |
| 233 static const int DATA_ERR = 5; |
| 234 |
| 235 static const int NON_TRANSIENT_ERR = 2; |
| 236 |
| 237 static const int NOT_ALLOWED_ERR = 6; |
| 238 |
| 239 static const int NOT_FOUND_ERR = 8; |
| 240 |
| 241 static const int NO_ERR = 0; |
| 242 |
| 243 static const int QUOTA_ERR = 22; |
| 244 |
| 245 static const int READ_ONLY_ERR = 9; |
| 246 |
| 247 static const int TIMEOUT_ERR = 23; |
| 248 |
| 249 static const int TRANSACTION_INACTIVE_ERR = 7; |
| 250 |
| 251 static const int UNKNOWN_ERR = 1; |
| 252 |
| 253 static const int VER_ERR = 12; |
| 254 |
| 255 |
| 256 /** @domName IDBDatabaseException.code */ |
| 257 int get code native "IDBDatabaseException_code_Getter"; |
| 258 |
| 259 |
| 260 /** @domName IDBDatabaseException.message */ |
| 261 String get message native "IDBDatabaseException_message_Getter"; |
| 262 |
| 263 |
| 264 /** @domName IDBDatabaseException.name */ |
| 265 String get name native "IDBDatabaseException_name_Getter"; |
| 266 |
| 267 |
| 268 /** @domName IDBDatabaseException.toString */ |
| 269 String toString() native "IDBDatabaseException_toString_Callback"; |
| 270 |
| 271 } |
| 272 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 273 // for details. All rights reserved. Use of this source code is governed by a |
| 274 // BSD-style license that can be found in the LICENSE file. |
| 275 |
| 276 // WARNING: Do not edit - generated code. |
| 277 |
| 278 |
| 279 /// @domName IDBFactory |
| 280 class IdbFactory extends NativeFieldWrapperClass1 { |
| 281 IdbFactory.internal(); |
| 282 |
| 283 |
| 284 /** @domName IDBFactory.cmp */ |
| 285 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) native "IDBFactory_cmp_Callback"; |
| 286 |
| 287 |
| 288 /** @domName IDBFactory.deleteDatabase */ |
| 289 VersionChangeRequest deleteDatabase(String name) native "IDBFactory_deleteData
base_Callback"; |
| 290 |
| 291 OpenDBRequest open(/*DOMString*/ name, [/*long long*/ version]) { |
| 292 if (?version) { |
| 293 return _open_1(name, version); |
| 294 } |
| 295 return _open_2(name); |
| 296 } |
| 297 |
| 298 |
| 299 /** @domName IDBFactory.open_1 */ |
| 300 OpenDBRequest _open_1(name, version) native "IDBFactory_open_1_Callback"; |
| 301 |
| 302 |
| 303 /** @domName IDBFactory.open_2 */ |
| 304 OpenDBRequest _open_2(name) native "IDBFactory_open_2_Callback"; |
| 305 |
| 306 |
| 307 /** @domName IDBFactory.webkitGetDatabaseNames */ |
| 308 Request webkitGetDatabaseNames() native "IDBFactory_webkitGetDatabaseNames_Cal
lback"; |
| 309 |
| 310 } |
| 311 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 312 // for details. All rights reserved. Use of this source code is governed by a |
| 313 // BSD-style license that can be found in the LICENSE file. |
| 314 |
| 315 // WARNING: Do not edit - generated code. |
| 316 |
| 317 |
| 318 /// @domName IDBIndex |
| 319 class Index extends NativeFieldWrapperClass1 { |
| 320 Index.internal(); |
| 321 |
| 322 |
| 323 /** @domName IDBIndex.keyPath */ |
| 324 dynamic get keyPath native "IDBIndex_keyPath_Getter"; |
| 325 |
| 326 |
| 327 /** @domName IDBIndex.multiEntry */ |
| 328 bool get multiEntry native "IDBIndex_multiEntry_Getter"; |
| 329 |
| 330 |
| 331 /** @domName IDBIndex.name */ |
| 332 String get name native "IDBIndex_name_Getter"; |
| 333 |
| 334 |
| 335 /** @domName IDBIndex.objectStore */ |
| 336 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; |
| 337 |
| 338 |
| 339 /** @domName IDBIndex.unique */ |
| 340 bool get unique native "IDBIndex_unique_Getter"; |
| 341 |
| 342 Request count([key_OR_range]) { |
| 343 if (!?key_OR_range) { |
| 344 return _count_1(); |
| 345 } |
| 346 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 347 return _count_2(key_OR_range); |
| 348 } |
| 349 return _count_3(key_OR_range); |
| 350 throw "Incorrect number or type of arguments"; |
| 351 } |
| 352 |
| 353 |
| 354 /** @domName IDBIndex.count_1 */ |
| 355 Request _count_1() native "IDBIndex_count_1_Callback"; |
| 356 |
| 357 |
| 358 /** @domName IDBIndex.count_2 */ |
| 359 Request _count_2(key_OR_range) native "IDBIndex_count_2_Callback"; |
| 360 |
| 361 |
| 362 /** @domName IDBIndex.count_3 */ |
| 363 Request _count_3(key_OR_range) native "IDBIndex_count_3_Callback"; |
| 364 |
| 365 Request get(key) { |
| 366 if ((key is KeyRange || key == null)) { |
| 367 return _get_1(key); |
| 368 } |
| 369 return _get_2(key); |
| 370 throw "Incorrect number or type of arguments"; |
| 371 } |
| 372 |
| 373 |
| 374 /** @domName IDBIndex.get_1 */ |
| 375 Request _get_1(key) native "IDBIndex_get_1_Callback"; |
| 376 |
| 377 |
| 378 /** @domName IDBIndex.get_2 */ |
| 379 Request _get_2(key) native "IDBIndex_get_2_Callback"; |
| 380 |
| 381 Request getKey(key) { |
| 382 if ((key is KeyRange || key == null)) { |
| 383 return _getKey_1(key); |
| 384 } |
| 385 return _getKey_2(key); |
| 386 throw "Incorrect number or type of arguments"; |
| 387 } |
| 388 |
| 389 |
| 390 /** @domName IDBIndex.getKey_1 */ |
| 391 Request _getKey_1(key) native "IDBIndex_getKey_1_Callback"; |
| 392 |
| 393 |
| 394 /** @domName IDBIndex.getKey_2 */ |
| 395 Request _getKey_2(key) native "IDBIndex_getKey_2_Callback"; |
| 396 |
| 397 Request openCursor([key_OR_range, /*DOMString*/ direction]) { |
| 398 if (!?key_OR_range && !?direction) { |
| 399 return _openCursor_1(); |
| 400 } |
| 401 if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) { |
| 402 return _openCursor_2(key_OR_range); |
| 403 } |
| 404 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { |
| 405 return _openCursor_3(key_OR_range, direction); |
| 406 } |
| 407 if (!?direction) { |
| 408 return _openCursor_4(key_OR_range); |
| 409 } |
| 410 if ((direction is String || direction == null)) { |
| 411 return _openCursor_5(key_OR_range, direction); |
| 412 } |
| 413 throw "Incorrect number or type of arguments"; |
| 414 } |
| 415 |
| 416 |
| 417 /** @domName IDBIndex.openCursor_1 */ |
| 418 Request _openCursor_1() native "IDBIndex_openCursor_1_Callback"; |
| 419 |
| 420 |
| 421 /** @domName IDBIndex.openCursor_2 */ |
| 422 Request _openCursor_2(key_OR_range) native "IDBIndex_openCursor_2_Callback"; |
| 423 |
| 424 |
| 425 /** @domName IDBIndex.openCursor_3 */ |
| 426 Request _openCursor_3(key_OR_range, direction) native "IDBIndex_openCursor_3_C
allback"; |
| 427 |
| 428 |
| 429 /** @domName IDBIndex.openCursor_4 */ |
| 430 Request _openCursor_4(key_OR_range) native "IDBIndex_openCursor_4_Callback"; |
| 431 |
| 432 |
| 433 /** @domName IDBIndex.openCursor_5 */ |
| 434 Request _openCursor_5(key_OR_range, direction) native "IDBIndex_openCursor_5_C
allback"; |
| 435 |
| 436 Request openKeyCursor([key_OR_range, /*DOMString*/ direction]) { |
| 437 if (!?key_OR_range && !?direction) { |
| 438 return _openKeyCursor_1(); |
| 439 } |
| 440 if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) { |
| 441 return _openKeyCursor_2(key_OR_range); |
| 442 } |
| 443 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { |
| 444 return _openKeyCursor_3(key_OR_range, direction); |
| 445 } |
| 446 if (!?direction) { |
| 447 return _openKeyCursor_4(key_OR_range); |
| 448 } |
| 449 if ((direction is String || direction == null)) { |
| 450 return _openKeyCursor_5(key_OR_range, direction); |
| 451 } |
| 452 throw "Incorrect number or type of arguments"; |
| 453 } |
| 454 |
| 455 |
| 456 /** @domName IDBIndex.openKeyCursor_1 */ |
| 457 Request _openKeyCursor_1() native "IDBIndex_openKeyCursor_1_Callback"; |
| 458 |
| 459 |
| 460 /** @domName IDBIndex.openKeyCursor_2 */ |
| 461 Request _openKeyCursor_2(key_OR_range) native "IDBIndex_openKeyCursor_2_Callba
ck"; |
| 462 |
| 463 |
| 464 /** @domName IDBIndex.openKeyCursor_3 */ |
| 465 Request _openKeyCursor_3(key_OR_range, direction) native "IDBIndex_openKeyCurs
or_3_Callback"; |
| 466 |
| 467 |
| 468 /** @domName IDBIndex.openKeyCursor_4 */ |
| 469 Request _openKeyCursor_4(key_OR_range) native "IDBIndex_openKeyCursor_4_Callba
ck"; |
| 470 |
| 471 |
| 472 /** @domName IDBIndex.openKeyCursor_5 */ |
| 473 Request _openKeyCursor_5(key_OR_range, direction) native "IDBIndex_openKeyCurs
or_5_Callback"; |
| 474 |
| 475 } |
| 476 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 477 // for details. All rights reserved. Use of this source code is governed by a |
| 478 // BSD-style license that can be found in the LICENSE file. |
| 479 |
| 480 // WARNING: Do not edit - generated code. |
| 481 |
| 482 |
| 483 /// @domName IDBKey |
| 484 class Key extends NativeFieldWrapperClass1 { |
| 485 Key.internal(); |
| 486 |
| 487 } |
| 488 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 489 // for details. All rights reserved. Use of this source code is governed by a |
| 490 // BSD-style license that can be found in the LICENSE file. |
| 491 |
| 492 |
| 493 /// @domName IDBKeyRange |
| 494 class KeyRange extends NativeFieldWrapperClass1 { |
| 495 /** |
| 496 * @domName IDBKeyRange.only |
| 497 */ |
| 498 factory KeyRange.only(/*Key*/ value) => |
| 499 _KeyRangeFactoryProvider.createKeyRange_only(value); |
| 500 |
| 501 /** |
| 502 * @domName IDBKeyRange.lowerBound |
| 503 */ |
| 504 factory KeyRange.lowerBound(/*Key*/ bound, [bool open = false]) => |
| 505 _KeyRangeFactoryProvider.createKeyRange_lowerBound(bound, open); |
| 506 |
| 507 /** |
| 508 * @domName IDBKeyRange.upperBound |
| 509 */ |
| 510 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) => |
| 511 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open); |
| 512 |
| 513 /** |
| 514 * @domName KeyRange.bound |
| 515 */ |
| 516 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, |
| 517 [bool lowerOpen = false, bool upperOpen = false]) => |
| 518 _KeyRangeFactoryProvider.createKeyRange_bound( |
| 519 lower, upper, lowerOpen, upperOpen); |
| 520 |
| 521 KeyRange.internal(); |
| 522 |
| 523 |
| 524 /** @domName IDBKeyRange.lower */ |
| 525 dynamic get lower native "IDBKeyRange_lower_Getter"; |
| 526 |
| 527 |
| 528 /** @domName IDBKeyRange.lowerOpen */ |
| 529 bool get lowerOpen native "IDBKeyRange_lowerOpen_Getter"; |
| 530 |
| 531 |
| 532 /** @domName IDBKeyRange.upper */ |
| 533 dynamic get upper native "IDBKeyRange_upper_Getter"; |
| 534 |
| 535 |
| 536 /** @domName IDBKeyRange.upperOpen */ |
| 537 bool get upperOpen native "IDBKeyRange_upperOpen_Getter"; |
| 538 |
| 539 static KeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [/*boolean*/ lowerO
pen, /*boolean*/ upperOpen]) { |
| 540 if (?upperOpen) { |
| 541 return _bound_1(lower, upper, lowerOpen, upperOpen); |
| 542 } |
| 543 if (?lowerOpen) { |
| 544 return _bound_2(lower, upper, lowerOpen); |
| 545 } |
| 546 return _bound_3(lower, upper); |
| 547 } |
| 548 |
| 549 |
| 550 /** @domName IDBKeyRange.bound_1 */ |
| 551 static KeyRange _bound_1(lower, upper, lowerOpen, upperOpen) native "IDBKeyRan
ge_bound_1_Callback"; |
| 552 |
| 553 |
| 554 /** @domName IDBKeyRange.bound_2 */ |
| 555 static KeyRange _bound_2(lower, upper, lowerOpen) native "IDBKeyRange_bound_2_
Callback"; |
| 556 |
| 557 |
| 558 /** @domName IDBKeyRange.bound_3 */ |
| 559 static KeyRange _bound_3(lower, upper) native "IDBKeyRange_bound_3_Callback"; |
| 560 |
| 561 static KeyRange lowerBound_(/*IDBKey*/ bound, [/*boolean*/ open]) { |
| 562 if (?open) { |
| 563 return _lowerBound_1(bound, open); |
| 564 } |
| 565 return _lowerBound_2(bound); |
| 566 } |
| 567 |
| 568 |
| 569 /** @domName IDBKeyRange.lowerBound_1 */ |
| 570 static KeyRange _lowerBound_1(bound, open) native "IDBKeyRange_lowerBound_1_Ca
llback"; |
| 571 |
| 572 |
| 573 /** @domName IDBKeyRange.lowerBound_2 */ |
| 574 static KeyRange _lowerBound_2(bound) native "IDBKeyRange_lowerBound_2_Callback
"; |
| 575 |
| 576 |
| 577 /** @domName IDBKeyRange.only_ */ |
| 578 static KeyRange only_(/*IDBKey*/ value) native "IDBKeyRange_only__Callback"; |
| 579 |
| 580 static KeyRange upperBound_(/*IDBKey*/ bound, [/*boolean*/ open]) { |
| 581 if (?open) { |
| 582 return _upperBound_1(bound, open); |
| 583 } |
| 584 return _upperBound_2(bound); |
| 585 } |
| 586 |
| 587 |
| 588 /** @domName IDBKeyRange.upperBound_1 */ |
| 589 static KeyRange _upperBound_1(bound, open) native "IDBKeyRange_upperBound_1_Ca
llback"; |
| 590 |
| 591 |
| 592 /** @domName IDBKeyRange.upperBound_2 */ |
| 593 static KeyRange _upperBound_2(bound) native "IDBKeyRange_upperBound_2_Callback
"; |
| 594 |
| 595 } |
| 596 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 597 // for details. All rights reserved. Use of this source code is governed by a |
| 598 // BSD-style license that can be found in the LICENSE file. |
| 599 |
| 600 // WARNING: Do not edit - generated code. |
| 601 |
| 602 |
| 603 /// @domName IDBObjectStore |
| 604 class ObjectStore extends NativeFieldWrapperClass1 { |
| 605 ObjectStore.internal(); |
| 606 |
| 607 |
| 608 /** @domName IDBObjectStore.autoIncrement */ |
| 609 bool get autoIncrement native "IDBObjectStore_autoIncrement_Getter"; |
| 610 |
| 611 |
| 612 /** @domName IDBObjectStore.indexNames */ |
| 613 List<String> get indexNames native "IDBObjectStore_indexNames_Getter"; |
| 614 |
| 615 |
| 616 /** @domName IDBObjectStore.keyPath */ |
| 617 dynamic get keyPath native "IDBObjectStore_keyPath_Getter"; |
| 618 |
| 619 |
| 620 /** @domName IDBObjectStore.name */ |
| 621 String get name native "IDBObjectStore_name_Getter"; |
| 622 |
| 623 |
| 624 /** @domName IDBObjectStore.transaction */ |
| 625 Transaction get transaction native "IDBObjectStore_transaction_Getter"; |
| 626 |
| 627 Request add(/*any*/ value, [/*IDBKey*/ key]) { |
| 628 if (?key) { |
| 629 return _add_1(value, key); |
| 630 } |
| 631 return _add_2(value); |
| 632 } |
| 633 |
| 634 |
| 635 /** @domName IDBObjectStore.add_1 */ |
| 636 Request _add_1(value, key) native "IDBObjectStore_add_1_Callback"; |
| 637 |
| 638 |
| 639 /** @domName IDBObjectStore.add_2 */ |
| 640 Request _add_2(value) native "IDBObjectStore_add_2_Callback"; |
| 641 |
| 642 |
| 643 /** @domName IDBObjectStore.clear */ |
| 644 Request clear() native "IDBObjectStore_clear_Callback"; |
| 645 |
| 646 Request count([key_OR_range]) { |
| 647 if (!?key_OR_range) { |
| 648 return _count_1(); |
| 649 } |
| 650 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 651 return _count_2(key_OR_range); |
| 652 } |
| 653 return _count_3(key_OR_range); |
| 654 throw "Incorrect number or type of arguments"; |
| 655 } |
| 656 |
| 657 |
| 658 /** @domName IDBObjectStore.count_1 */ |
| 659 Request _count_1() native "IDBObjectStore_count_1_Callback"; |
| 660 |
| 661 |
| 662 /** @domName IDBObjectStore.count_2 */ |
| 663 Request _count_2(key_OR_range) native "IDBObjectStore_count_2_Callback"; |
| 664 |
| 665 |
| 666 /** @domName IDBObjectStore.count_3 */ |
| 667 Request _count_3(key_OR_range) native "IDBObjectStore_count_3_Callback"; |
| 668 |
| 669 Index createIndex(/*DOMString*/ name, keyPath, [/*Dictionary*/ options]) { |
| 670 if ((name is String || name == null) && (keyPath is List<String> || keyPath
== null) && (options is Map || options == null)) { |
| 671 return _createIndex_1(name, keyPath, options); |
| 672 } |
| 673 if ((name is String || name == null) && (keyPath is String || keyPath == nul
l) && (options is Map || options == null)) { |
| 674 return _createIndex_2(name, keyPath, options); |
| 675 } |
| 676 throw "Incorrect number or type of arguments"; |
| 677 } |
| 678 |
| 679 |
| 680 /** @domName IDBObjectStore.createIndex_1 */ |
| 681 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore_createInde
x_1_Callback"; |
| 682 |
| 683 |
| 684 /** @domName IDBObjectStore.createIndex_2 */ |
| 685 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore_createInde
x_2_Callback"; |
| 686 |
| 687 Request delete(key_OR_keyRange) { |
| 688 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { |
| 689 return _delete_1(key_OR_keyRange); |
| 690 } |
| 691 return _delete_2(key_OR_keyRange); |
| 692 throw "Incorrect number or type of arguments"; |
| 693 } |
| 694 |
| 695 |
| 696 /** @domName IDBObjectStore.delete_1 */ |
| 697 Request _delete_1(key_OR_keyRange) native "IDBObjectStore_delete_1_Callback"; |
| 698 |
| 699 |
| 700 /** @domName IDBObjectStore.delete_2 */ |
| 701 Request _delete_2(key_OR_keyRange) native "IDBObjectStore_delete_2_Callback"; |
| 702 |
| 703 |
| 704 /** @domName IDBObjectStore.deleteIndex */ |
| 705 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; |
| 706 |
| 707 Request getObject(key) { |
| 708 if ((key is KeyRange || key == null)) { |
| 709 return _get_1(key); |
| 710 } |
| 711 return _get_2(key); |
| 712 throw "Incorrect number or type of arguments"; |
| 713 } |
| 714 |
| 715 |
| 716 /** @domName IDBObjectStore.get_1 */ |
| 717 Request _get_1(key) native "IDBObjectStore_get_1_Callback"; |
| 718 |
| 719 |
| 720 /** @domName IDBObjectStore.get_2 */ |
| 721 Request _get_2(key) native "IDBObjectStore_get_2_Callback"; |
| 722 |
| 723 |
| 724 /** @domName IDBObjectStore.index */ |
| 725 Index index(String name) native "IDBObjectStore_index_Callback"; |
| 726 |
| 727 Request openCursor([key_OR_range, /*DOMString*/ direction]) { |
| 728 if (!?key_OR_range && !?direction) { |
| 729 return _openCursor_1(); |
| 730 } |
| 731 if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) { |
| 732 return _openCursor_2(key_OR_range); |
| 733 } |
| 734 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { |
| 735 return _openCursor_3(key_OR_range, direction); |
| 736 } |
| 737 if (!?direction) { |
| 738 return _openCursor_4(key_OR_range); |
| 739 } |
| 740 if ((direction is String || direction == null)) { |
| 741 return _openCursor_5(key_OR_range, direction); |
| 742 } |
| 743 throw "Incorrect number or type of arguments"; |
| 744 } |
| 745 |
| 746 |
| 747 /** @domName IDBObjectStore.openCursor_1 */ |
| 748 Request _openCursor_1() native "IDBObjectStore_openCursor_1_Callback"; |
| 749 |
| 750 |
| 751 /** @domName IDBObjectStore.openCursor_2 */ |
| 752 Request _openCursor_2(key_OR_range) native "IDBObjectStore_openCursor_2_Callba
ck"; |
| 753 |
| 754 |
| 755 /** @domName IDBObjectStore.openCursor_3 */ |
| 756 Request _openCursor_3(key_OR_range, direction) native "IDBObjectStore_openCurs
or_3_Callback"; |
| 757 |
| 758 |
| 759 /** @domName IDBObjectStore.openCursor_4 */ |
| 760 Request _openCursor_4(key_OR_range) native "IDBObjectStore_openCursor_4_Callba
ck"; |
| 761 |
| 762 |
| 763 /** @domName IDBObjectStore.openCursor_5 */ |
| 764 Request _openCursor_5(key_OR_range, direction) native "IDBObjectStore_openCurs
or_5_Callback"; |
| 765 |
| 766 Request put(/*any*/ value, [/*IDBKey*/ key]) { |
| 767 if (?key) { |
| 768 return _put_1(value, key); |
| 769 } |
| 770 return _put_2(value); |
| 771 } |
| 772 |
| 773 |
| 774 /** @domName IDBObjectStore.put_1 */ |
| 775 Request _put_1(value, key) native "IDBObjectStore_put_1_Callback"; |
| 776 |
| 777 |
| 778 /** @domName IDBObjectStore.put_2 */ |
| 779 Request _put_2(value) native "IDBObjectStore_put_2_Callback"; |
| 780 |
| 781 } |
| 782 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 783 // for details. All rights reserved. Use of this source code is governed by a |
| 784 // BSD-style license that can be found in the LICENSE file. |
| 785 |
| 786 // WARNING: Do not edit - generated code. |
| 787 |
| 788 |
| 789 /// @domName IDBOpenDBRequest |
| 790 class OpenDBRequest extends Request implements EventTarget { |
| 791 OpenDBRequest.internal(): super.internal(); |
| 792 |
| 793 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 794 OpenDBRequestEvents get on => |
| 795 new OpenDBRequestEvents(this); |
| 796 |
| 797 } |
| 798 |
| 799 class OpenDBRequestEvents extends RequestEvents { |
| 800 OpenDBRequestEvents(EventTarget _ptr) : super(_ptr); |
| 801 |
| 802 EventListenerList get blocked => this['blocked']; |
| 803 |
| 804 EventListenerList get upgradeNeeded => this['upgradeneeded']; |
| 805 } |
| 806 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 807 // for details. All rights reserved. Use of this source code is governed by a |
| 808 // BSD-style license that can be found in the LICENSE file. |
| 809 |
| 810 // WARNING: Do not edit - generated code. |
| 811 |
| 812 |
| 813 /// @domName IDBRequest |
| 814 class Request extends EventTarget { |
| 815 Request.internal(): super.internal(); |
| 816 |
| 817 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 818 RequestEvents get on => |
| 819 new RequestEvents(this); |
| 820 |
| 821 |
| 822 /** @domName IDBRequest.error */ |
| 823 DomError get error native "IDBRequest_error_Getter"; |
| 824 |
| 825 |
| 826 /** @domName IDBRequest.errorCode */ |
| 827 int get errorCode native "IDBRequest_errorCode_Getter"; |
| 828 |
| 829 |
| 830 /** @domName IDBRequest.readyState */ |
| 831 String get readyState native "IDBRequest_readyState_Getter"; |
| 832 |
| 833 |
| 834 /** @domName IDBRequest.result */ |
| 835 dynamic get result native "IDBRequest_result_Getter"; |
| 836 |
| 837 |
| 838 /** @domName IDBRequest.source */ |
| 839 dynamic get source native "IDBRequest_source_Getter"; |
| 840 |
| 841 |
| 842 /** @domName IDBRequest.transaction */ |
| 843 Transaction get transaction native "IDBRequest_transaction_Getter"; |
| 844 |
| 845 |
| 846 /** @domName IDBRequest.webkitErrorMessage */ |
| 847 String get webkitErrorMessage native "IDBRequest_webkitErrorMessage_Getter"; |
| 848 |
| 849 |
| 850 /** @domName IDBRequest.addEventListener */ |
| 851 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBRequest_addEventListener_Callback"; |
| 852 |
| 853 |
| 854 /** @domName IDBRequest.dispatchEvent */ |
| 855 bool $dom_dispatchEvent(Event evt) native "IDBRequest_dispatchEvent_Callback"; |
| 856 |
| 857 |
| 858 /** @domName IDBRequest.removeEventListener */ |
| 859 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBRequest_removeEventListener_Callback"; |
| 860 |
| 861 } |
| 862 |
| 863 class RequestEvents extends Events { |
| 864 RequestEvents(EventTarget _ptr) : super(_ptr); |
| 865 |
| 866 EventListenerList get error => this['error']; |
| 867 |
| 868 EventListenerList get success => this['success']; |
| 869 } |
| 870 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 871 // for details. All rights reserved. Use of this source code is governed by a |
| 872 // BSD-style license that can be found in the LICENSE file. |
| 873 |
| 874 // WARNING: Do not edit - generated code. |
| 875 |
| 876 |
| 877 /// @domName IDBTransaction |
| 878 class Transaction extends EventTarget { |
| 879 Transaction.internal(): super.internal(); |
| 880 |
| 881 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 882 TransactionEvents get on => |
| 883 new TransactionEvents(this); |
| 884 |
| 885 static const int READ_ONLY = 0; |
| 886 |
| 887 static const int READ_WRITE = 1; |
| 888 |
| 889 static const int VERSION_CHANGE = 2; |
| 890 |
| 891 |
| 892 /** @domName IDBTransaction.db */ |
| 893 Database get db native "IDBTransaction_db_Getter"; |
| 894 |
| 895 |
| 896 /** @domName IDBTransaction.error */ |
| 897 DomError get error native "IDBTransaction_error_Getter"; |
| 898 |
| 899 |
| 900 /** @domName IDBTransaction.mode */ |
| 901 String get mode native "IDBTransaction_mode_Getter"; |
| 902 |
| 903 |
| 904 /** @domName IDBTransaction.abort */ |
| 905 void abort() native "IDBTransaction_abort_Callback"; |
| 906 |
| 907 |
| 908 /** @domName IDBTransaction.addEventListener */ |
| 909 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBTransaction_addEventListener_Callback"; |
| 910 |
| 911 |
| 912 /** @domName IDBTransaction.dispatchEvent */ |
| 913 bool $dom_dispatchEvent(Event evt) native "IDBTransaction_dispatchEvent_Callba
ck"; |
| 914 |
| 915 |
| 916 /** @domName IDBTransaction.objectStore */ |
| 917 ObjectStore objectStore(String name) native "IDBTransaction_objectStore_Callba
ck"; |
| 918 |
| 919 |
| 920 /** @domName IDBTransaction.removeEventListener */ |
| 921 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBTransaction_removeEventListener_Callback"; |
| 922 |
| 923 } |
| 924 |
| 925 class TransactionEvents extends Events { |
| 926 TransactionEvents(EventTarget _ptr) : super(_ptr); |
| 927 |
| 928 EventListenerList get abort => this['abort']; |
| 929 |
| 930 EventListenerList get complete => this['complete']; |
| 931 |
| 932 EventListenerList get error => this['error']; |
| 933 } |
| 934 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 935 // for details. All rights reserved. Use of this source code is governed by a |
| 936 // BSD-style license that can be found in the LICENSE file. |
| 937 |
| 938 // WARNING: Do not edit - generated code. |
| 939 |
| 940 |
| 941 /// @domName IDBVersionChangeEvent |
| 942 class UpgradeNeededEvent extends Event { |
| 943 UpgradeNeededEvent.internal(): super.internal(); |
| 944 |
| 945 |
| 946 /** @domName IDBUpgradeNeededEvent.newVersion */ |
| 947 int get newVersion native "IDBUpgradeNeededEvent_newVersion_Getter"; |
| 948 |
| 949 |
| 950 /** @domName IDBUpgradeNeededEvent.oldVersion */ |
| 951 int get oldVersion native "IDBUpgradeNeededEvent_oldVersion_Getter"; |
| 952 |
| 953 } |
| 954 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 955 // for details. All rights reserved. Use of this source code is governed by a |
| 956 // BSD-style license that can be found in the LICENSE file. |
| 957 |
| 958 // WARNING: Do not edit - generated code. |
| 959 |
| 960 |
| 961 /// @domName IDBVersionChangeEvent |
| 962 class VersionChangeEvent extends Event { |
| 963 VersionChangeEvent.internal(): super.internal(); |
| 964 |
| 965 |
| 966 /** @domName IDBVersionChangeEvent.version */ |
| 967 String get version native "IDBVersionChangeEvent_version_Getter"; |
| 968 |
| 969 } |
| 970 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 971 // for details. All rights reserved. Use of this source code is governed by a |
| 972 // BSD-style license that can be found in the LICENSE file. |
| 973 |
| 974 // WARNING: Do not edit - generated code. |
| 975 |
| 976 |
| 977 /// @domName IDBVersionChangeRequest |
| 978 class VersionChangeRequest extends Request implements EventTarget { |
| 979 VersionChangeRequest.internal(): super.internal(); |
| 980 |
| 981 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 982 VersionChangeRequestEvents get on => |
| 983 new VersionChangeRequestEvents(this); |
| 984 |
| 985 } |
| 986 |
| 987 class VersionChangeRequestEvents extends RequestEvents { |
| 988 VersionChangeRequestEvents(EventTarget _ptr) : super(_ptr); |
| 989 |
| 990 EventListenerList get blocked => this['blocked']; |
| 991 } |
OLD | NEW |