Database.hx 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright (C)2005-2017 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\IDBDatabase.webidl. Do not edit!
  23. package js.html.idb;
  24. /**
  25. Inherits from: EventTarget
  26. Documentation [IDBDatabase](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase>
  28. **/
  29. @:native("IDBDatabase")
  30. extern class Database extends js.html.EventTarget
  31. {
  32. /**
  33. A `DOMString` that contains the name of the connected database.
  34. **/
  35. var name(default,null) : String;
  36. /**
  37. A 64-bit integer that contains the version of the connected database. When a database is first created, this attribute is an empty string.
  38. **/
  39. var version(default,null) : Int;
  40. /**
  41. A `DOMStringList` that contains a list of the names of the object stores currently in the connected database.
  42. **/
  43. var objectStoreNames(default,null) : js.html.DOMStringList;
  44. /**
  45. Fires when access of the database is aborted.
  46. **/
  47. var onabort : haxe.Constraints.Function;
  48. /**
  49. Fires when access to the database fails.
  50. **/
  51. var onerror : haxe.Constraints.Function;
  52. /**
  53. Fires when a database structure change (`IDBOpenDBRequest.onupgradeneeded` event or` ``IDBFactory.deleteDatabase()` was requested elsewhere (most probably in another window/tab on the same computer). This is different from the version change transaction (see `IDBVersionChangeEvent`), but it is related.
  54. **/
  55. var onversionchange : haxe.Constraints.Function;
  56. /** @throws DOMError */
  57. /**
  58. Creates and returns a new object store or index.
  59. **/
  60. function createObjectStore( name : String, ?optionalParameters : ObjectStoreParameters ) : ObjectStore;
  61. /** @throws DOMError */
  62. /**
  63. Destroys the object store with the given name in the connected database, along with any indexes that reference it.
  64. **/
  65. function deleteObjectStore( name : String ) : Void;
  66. /** @throws DOMError */
  67. /**
  68. Immediately returns a transaction object (`IDBTransaction`) containing the `IDBTransaction.objectStore` method, which you can use to access your object store. Runs in a separate thread.
  69. **/
  70. function transaction( storeNames : haxe.extern.EitherType<String,Array<String>>, ?mode : TransactionMode = "readonly" ) : Transaction;
  71. /**
  72. Returns immediately and closes the connection to a database in a separate thread.
  73. **/
  74. function close() : Void;
  75. /** @throws DOMError */
  76. function createMutableFile( name : String, ?type : String ) : Request;
  77. }