| OLD | NEW |
| (Empty) | |
| 1 library dart.dom.web_sql; |
| 2 |
| 3 import 'dart:async'; |
| 4 import 'dart:collection'; |
| 5 import 'dart:html'; |
| 6 import 'dart:html_common'; |
| 7 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexin
gBehavior, JSName; |
| 8 import 'dart:_foreign_helper' show JS; |
| 9 // DO NOT EDIT - unless you are editing documentation as per: |
| 10 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation |
| 11 // Auto-generated dart:audio library. |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 17 // for details. All rights reserved. Use of this source code is governed by a |
| 18 // BSD-style license that can be found in the LICENSE file. |
| 19 |
| 20 // WARNING: Do not edit - generated code. |
| 21 |
| 22 |
| 23 typedef void DatabaseCallback(database); |
| 24 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 25 // for details. All rights reserved. Use of this source code is governed by a |
| 26 // BSD-style license that can be found in the LICENSE file. |
| 27 |
| 28 // WARNING: Do not edit - generated code. |
| 29 |
| 30 |
| 31 typedef void SqlStatementCallback(SqlTransaction transaction, SqlResultSet resul
tSet); |
| 32 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 33 // for details. All rights reserved. Use of this source code is governed by a |
| 34 // BSD-style license that can be found in the LICENSE file. |
| 35 |
| 36 // WARNING: Do not edit - generated code. |
| 37 |
| 38 |
| 39 typedef void SqlStatementErrorCallback(SqlTransaction transaction, SqlError erro
r); |
| 40 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 41 // for details. All rights reserved. Use of this source code is governed by a |
| 42 // BSD-style license that can be found in the LICENSE file. |
| 43 |
| 44 // WARNING: Do not edit - generated code. |
| 45 |
| 46 |
| 47 typedef void SqlTransactionCallback(SqlTransaction transaction); |
| 48 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 49 // for details. All rights reserved. Use of this source code is governed by a |
| 50 // BSD-style license that can be found in the LICENSE file. |
| 51 |
| 52 // WARNING: Do not edit - generated code. |
| 53 |
| 54 |
| 55 typedef void SqlTransactionErrorCallback(SqlError error); |
| 56 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 57 // for details. All rights reserved. Use of this source code is governed by a |
| 58 // BSD-style license that can be found in the LICENSE file. |
| 59 |
| 60 // WARNING: Do not edit - generated code. |
| 61 |
| 62 |
| 63 typedef void SqlTransactionSyncCallback(SqlTransactionSync transaction); |
| 64 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 65 // for details. All rights reserved. Use of this source code is governed by a |
| 66 // BSD-style license that can be found in the LICENSE file. |
| 67 |
| 68 |
| 69 @DocsEditable |
| 70 @DomName('Database') |
| 71 @SupportedBrowser(SupportedBrowser.CHROME) |
| 72 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 73 @Experimental |
| 74 class SqlDatabase native "*Database" { |
| 75 |
| 76 /// Checks if this type is supported on the current platform. |
| 77 static bool get supported => JS('bool', '!!(window.openDatabase)'); |
| 78 |
| 79 @DomName('Database.version') |
| 80 @DocsEditable |
| 81 final String version; |
| 82 |
| 83 @DomName('Database.changeVersion') |
| 84 @DocsEditable |
| 85 void changeVersion(String oldVersion, String newVersion, [SqlTransactionCallba
ck callback, SqlTransactionErrorCallback errorCallback, VoidCallback successCall
back]) native; |
| 86 |
| 87 @DomName('Database.readTransaction') |
| 88 @DocsEditable |
| 89 void readTransaction(SqlTransactionCallback callback, [SqlTransactionErrorCall
back errorCallback, VoidCallback successCallback]) native; |
| 90 |
| 91 @DomName('Database.transaction') |
| 92 @DocsEditable |
| 93 void transaction(SqlTransactionCallback callback, [SqlTransactionErrorCallback
errorCallback, VoidCallback successCallback]) native; |
| 94 } |
| 95 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 96 // for details. All rights reserved. Use of this source code is governed by a |
| 97 // BSD-style license that can be found in the LICENSE file. |
| 98 |
| 99 |
| 100 @DocsEditable |
| 101 @DomName('DatabaseSync') |
| 102 @SupportedBrowser(SupportedBrowser.CHROME) |
| 103 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 104 @Experimental |
| 105 class SqlDatabaseSync native "*DatabaseSync" { |
| 106 |
| 107 @DomName('DatabaseSync.lastErrorMessage') |
| 108 @DocsEditable |
| 109 final String lastErrorMessage; |
| 110 |
| 111 @DomName('DatabaseSync.version') |
| 112 @DocsEditable |
| 113 final String version; |
| 114 |
| 115 @DomName('DatabaseSync.changeVersion') |
| 116 @DocsEditable |
| 117 void changeVersion(String oldVersion, String newVersion, [SqlTransactionSyncCa
llback callback]) native; |
| 118 |
| 119 @DomName('DatabaseSync.readTransaction') |
| 120 @DocsEditable |
| 121 void readTransaction(SqlTransactionSyncCallback callback) native; |
| 122 |
| 123 @DomName('DatabaseSync.transaction') |
| 124 @DocsEditable |
| 125 void transaction(SqlTransactionSyncCallback callback) native; |
| 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 |
| 132 @DocsEditable |
| 133 @DomName('SQLError') |
| 134 class SqlError native "*SQLError" { |
| 135 |
| 136 static const int CONSTRAINT_ERR = 6; |
| 137 |
| 138 static const int DATABASE_ERR = 1; |
| 139 |
| 140 static const int QUOTA_ERR = 4; |
| 141 |
| 142 static const int SYNTAX_ERR = 5; |
| 143 |
| 144 static const int TIMEOUT_ERR = 7; |
| 145 |
| 146 static const int TOO_LARGE_ERR = 3; |
| 147 |
| 148 static const int UNKNOWN_ERR = 0; |
| 149 |
| 150 static const int VERSION_ERR = 2; |
| 151 |
| 152 @DomName('SQLError.code') |
| 153 @DocsEditable |
| 154 final int code; |
| 155 |
| 156 @DomName('SQLError.message') |
| 157 @DocsEditable |
| 158 final String message; |
| 159 } |
| 160 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 161 // for details. All rights reserved. Use of this source code is governed by a |
| 162 // BSD-style license that can be found in the LICENSE file. |
| 163 |
| 164 |
| 165 @DocsEditable |
| 166 @DomName('SQLException') |
| 167 class SqlException native "*SQLException" { |
| 168 |
| 169 static const int CONSTRAINT_ERR = 6; |
| 170 |
| 171 static const int DATABASE_ERR = 1; |
| 172 |
| 173 static const int QUOTA_ERR = 4; |
| 174 |
| 175 static const int SYNTAX_ERR = 5; |
| 176 |
| 177 static const int TIMEOUT_ERR = 7; |
| 178 |
| 179 static const int TOO_LARGE_ERR = 3; |
| 180 |
| 181 static const int UNKNOWN_ERR = 0; |
| 182 |
| 183 static const int VERSION_ERR = 2; |
| 184 |
| 185 @DomName('SQLException.code') |
| 186 @DocsEditable |
| 187 final int code; |
| 188 |
| 189 @DomName('SQLException.message') |
| 190 @DocsEditable |
| 191 final String message; |
| 192 } |
| 193 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 194 // for details. All rights reserved. Use of this source code is governed by a |
| 195 // BSD-style license that can be found in the LICENSE file. |
| 196 |
| 197 |
| 198 @DocsEditable |
| 199 @DomName('SQLResultSet') |
| 200 class SqlResultSet native "*SQLResultSet" { |
| 201 |
| 202 @DomName('SQLResultSet.insertId') |
| 203 @DocsEditable |
| 204 final int insertId; |
| 205 |
| 206 @DomName('SQLResultSet.rows') |
| 207 @DocsEditable |
| 208 final SqlResultSetRowList rows; |
| 209 |
| 210 @DomName('SQLResultSet.rowsAffected') |
| 211 @DocsEditable |
| 212 final int rowsAffected; |
| 213 } |
| 214 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 215 // for details. All rights reserved. Use of this source code is governed by a |
| 216 // BSD-style license that can be found in the LICENSE file. |
| 217 |
| 218 |
| 219 @DocsEditable |
| 220 @DomName('SQLResultSetRowList') |
| 221 class SqlResultSetRowList implements JavaScriptIndexingBehavior, List<Map> nativ
e "*SQLResultSetRowList" { |
| 222 |
| 223 @DomName('SQLResultSetRowList.length') |
| 224 @DocsEditable |
| 225 int get length => JS("int", "#.length", this); |
| 226 |
| 227 Map operator[](int index) => JS("Map", "#[#]", this, index); |
| 228 |
| 229 void operator[]=(int index, Map value) { |
| 230 throw new UnsupportedError("Cannot assign element of immutable List."); |
| 231 } |
| 232 // -- start List<Map> mixins. |
| 233 // Map is the element type. |
| 234 |
| 235 // From Iterable<Map>: |
| 236 |
| 237 Iterator<Map> get iterator { |
| 238 // Note: NodeLists are not fixed size. And most probably length shouldn't |
| 239 // be cached in both iterator _and_ forEach method. For now caching it |
| 240 // for consistency. |
| 241 return new FixedSizeListIterator<Map>(this); |
| 242 } |
| 243 |
| 244 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Map)) { |
| 245 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| 246 } |
| 247 |
| 248 bool contains(Map element) => IterableMixinWorkaround.contains(this, element); |
| 249 |
| 250 void forEach(void f(Map element)) => IterableMixinWorkaround.forEach(this, f); |
| 251 |
| 252 String join([String separator]) => |
| 253 IterableMixinWorkaround.joinList(this, separator); |
| 254 |
| 255 Iterable map(f(Map element)) => |
| 256 IterableMixinWorkaround.mapList(this, f); |
| 257 |
| 258 Iterable<Map> where(bool f(Map element)) => |
| 259 IterableMixinWorkaround.where(this, f); |
| 260 |
| 261 Iterable expand(Iterable f(Map element)) => |
| 262 IterableMixinWorkaround.expand(this, f); |
| 263 |
| 264 bool every(bool f(Map element)) => IterableMixinWorkaround.every(this, f); |
| 265 |
| 266 bool any(bool f(Map element)) => IterableMixinWorkaround.any(this, f); |
| 267 |
| 268 List<Map> toList() => new List<Map>.from(this); |
| 269 Set<Map> toSet() => new Set<Map>.from(this); |
| 270 |
| 271 bool get isEmpty => this.length == 0; |
| 272 |
| 273 Iterable<Map> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| 274 |
| 275 Iterable<Map> takeWhile(bool test(Map value)) { |
| 276 return IterableMixinWorkaround.takeWhile(this, test); |
| 277 } |
| 278 |
| 279 Iterable<Map> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| 280 |
| 281 Iterable<Map> skipWhile(bool test(Map value)) { |
| 282 return IterableMixinWorkaround.skipWhile(this, test); |
| 283 } |
| 284 |
| 285 Map firstMatching(bool test(Map value), { Map orElse() }) { |
| 286 return IterableMixinWorkaround.firstMatching(this, test, orElse); |
| 287 } |
| 288 |
| 289 Map lastMatching(bool test(Map value), {Map orElse()}) { |
| 290 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); |
| 291 } |
| 292 |
| 293 Map singleMatching(bool test(Map value)) { |
| 294 return IterableMixinWorkaround.singleMatching(this, test); |
| 295 } |
| 296 |
| 297 Map elementAt(int index) { |
| 298 return this[index]; |
| 299 } |
| 300 |
| 301 // From Collection<Map>: |
| 302 |
| 303 void add(Map value) { |
| 304 throw new UnsupportedError("Cannot add to immutable List."); |
| 305 } |
| 306 |
| 307 void addLast(Map value) { |
| 308 throw new UnsupportedError("Cannot add to immutable List."); |
| 309 } |
| 310 |
| 311 void addAll(Iterable<Map> iterable) { |
| 312 throw new UnsupportedError("Cannot add to immutable List."); |
| 313 } |
| 314 |
| 315 // From List<Map>: |
| 316 void set length(int value) { |
| 317 throw new UnsupportedError("Cannot resize immutable List."); |
| 318 } |
| 319 |
| 320 void clear() { |
| 321 throw new UnsupportedError("Cannot clear immutable List."); |
| 322 } |
| 323 |
| 324 Iterable<Map> get reversed { |
| 325 return IterableMixinWorkaround.reversedList(this); |
| 326 } |
| 327 |
| 328 void sort([int compare(Map a, Map b)]) { |
| 329 throw new UnsupportedError("Cannot sort immutable List."); |
| 330 } |
| 331 |
| 332 int indexOf(Map element, [int start = 0]) => |
| 333 Lists.indexOf(this, element, start, this.length); |
| 334 |
| 335 int lastIndexOf(Map element, [int start]) { |
| 336 if (start == null) start = length - 1; |
| 337 return Lists.lastIndexOf(this, element, start); |
| 338 } |
| 339 |
| 340 Map get first { |
| 341 if (this.length > 0) return this[0]; |
| 342 throw new StateError("No elements"); |
| 343 } |
| 344 |
| 345 Map get last { |
| 346 if (this.length > 0) return this[this.length - 1]; |
| 347 throw new StateError("No elements"); |
| 348 } |
| 349 |
| 350 Map get single { |
| 351 if (length == 1) return this[0]; |
| 352 if (length == 0) throw new StateError("No elements"); |
| 353 throw new StateError("More than one element"); |
| 354 } |
| 355 |
| 356 Map min([int compare(Map a, Map b)]) => |
| 357 IterableMixinWorkaround.min(this, compare); |
| 358 |
| 359 Map max([int compare(Map a, Map b)]) => |
| 360 IterableMixinWorkaround.max(this, compare); |
| 361 |
| 362 Map removeAt(int pos) { |
| 363 throw new UnsupportedError("Cannot remove from immutable List."); |
| 364 } |
| 365 |
| 366 Map removeLast() { |
| 367 throw new UnsupportedError("Cannot remove from immutable List."); |
| 368 } |
| 369 |
| 370 void remove(Object object) { |
| 371 throw new UnsupportedError("Cannot remove from immutable List."); |
| 372 } |
| 373 |
| 374 void removeAll(Iterable elements) { |
| 375 throw new UnsupportedError("Cannot remove from immutable List."); |
| 376 } |
| 377 |
| 378 void retainAll(Iterable elements) { |
| 379 throw new UnsupportedError("Cannot remove from immutable List."); |
| 380 } |
| 381 |
| 382 void removeMatching(bool test(Map element)) { |
| 383 throw new UnsupportedError("Cannot remove from immutable List."); |
| 384 } |
| 385 |
| 386 void retainMatching(bool test(Map element)) { |
| 387 throw new UnsupportedError("Cannot remove from immutable List."); |
| 388 } |
| 389 |
| 390 void setRange(int start, int rangeLength, List<Map> from, [int startFrom]) { |
| 391 throw new UnsupportedError("Cannot setRange on immutable List."); |
| 392 } |
| 393 |
| 394 void removeRange(int start, int rangeLength) { |
| 395 throw new UnsupportedError("Cannot removeRange on immutable List."); |
| 396 } |
| 397 |
| 398 void insertRange(int start, int rangeLength, [Map initialValue]) { |
| 399 throw new UnsupportedError("Cannot insertRange on immutable List."); |
| 400 } |
| 401 |
| 402 List<Map> getRange(int start, int rangeLength) => |
| 403 Lists.getRange(this, start, rangeLength, <Map>[]); |
| 404 |
| 405 // -- end List<Map> mixins. |
| 406 |
| 407 @DomName('SQLResultSetRowList.item') |
| 408 @DocsEditable |
| 409 @Creates('=Object') |
| 410 Map item(int index) { |
| 411 return convertNativeToDart_Dictionary(_item_1(index)); |
| 412 } |
| 413 @JSName('item') |
| 414 @DomName('SQLResultSetRowList.item') |
| 415 @DocsEditable |
| 416 @Creates('=Object') |
| 417 _item_1(index) native; |
| 418 } |
| 419 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 420 // for details. All rights reserved. Use of this source code is governed by a |
| 421 // BSD-style license that can be found in the LICENSE file. |
| 422 |
| 423 |
| 424 @DocsEditable |
| 425 @DomName('SQLTransaction') |
| 426 @SupportedBrowser(SupportedBrowser.CHROME) |
| 427 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 428 @Experimental |
| 429 class SqlTransaction native "*SQLTransaction" { |
| 430 |
| 431 @DomName('SQLTransaction.executeSql') |
| 432 @DocsEditable |
| 433 void executeSql(String sqlStatement, List arguments, [SqlStatementCallback cal
lback, SqlStatementErrorCallback errorCallback]) native; |
| 434 } |
| 435 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 436 // for details. All rights reserved. Use of this source code is governed by a |
| 437 // BSD-style license that can be found in the LICENSE file. |
| 438 |
| 439 |
| 440 @DocsEditable |
| 441 @DomName('SQLTransactionSync') |
| 442 @SupportedBrowser(SupportedBrowser.CHROME) |
| 443 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 444 @Experimental |
| 445 class SqlTransactionSync native "*SQLTransactionSync" { |
| 446 |
| 447 @DomName('SQLTransactionSync.executeSql') |
| 448 @DocsEditable |
| 449 SqlResultSet executeSql(String sqlStatement, List arguments) native; |
| 450 } |
| OLD | NEW |