Index.hx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright (C)2005-2018 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\IDBIndex.webidl. Do not edit!
  23. package js.html.idb;
  24. /**
  25. `IDBIndex` interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data.
  26. Documentation [IDBIndex](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex$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/IDBIndex>
  28. **/
  29. @:native("IDBIndex")
  30. extern class Index
  31. {
  32. /**
  33. The name of this index.
  34. **/
  35. var name(default,null) : String;
  36. /**
  37. The name of the object store referenced by this index.
  38. **/
  39. var objectStore(default,null) : ObjectStore;
  40. /**
  41. The key path of this index. If null, this index is not auto-populated.
  42. **/
  43. var keyPath(default,null) : Dynamic;
  44. /**
  45. Affects how the index behaves when the result of evaluating the index's key path yields an array. If `true`, there is one record in the index for each item in an array of keys. If `false`, then there is one record for each key that is an array.
  46. **/
  47. var multiEntry(default,null) : Bool;
  48. /**
  49. If `true`, this index does not allow duplicate values for a key.
  50. **/
  51. var unique(default,null) : Bool;
  52. /** @throws DOMError */
  53. /**
  54. Returns an `IDBRequest` object, and, in a separate thread, creates a cursor over the specified key range.
  55. **/
  56. function openCursor( ?range : Dynamic, ?direction : CursorDirection = "next" ) : Request;
  57. /** @throws DOMError */
  58. /**
  59. Returns an `IDBRequest` object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index.
  60. **/
  61. function openKeyCursor( ?range : Dynamic, ?direction : CursorDirection = "next" ) : Request;
  62. /** @throws DOMError */
  63. /**
  64. Returns an `IDBRequest` object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if `key` is an `IDBKeyRange`.
  65. **/
  66. function get( key : Dynamic ) : Request;
  67. /** @throws DOMError */
  68. /**
  69. Returns an `IDBRequest` object, and, in a separate thread, finds either the given key or the primary key, if `key` is an `IDBKeyRange`.
  70. **/
  71. function getKey( key : Dynamic ) : Request;
  72. /** @throws DOMError */
  73. /**
  74. Returns an `IDBRequest` object, and in a separate thread, returns the number of records within a key range.
  75. **/
  76. function count( ?key : Dynamic ) : Request;
  77. /** @throws DOMError */
  78. /**
  79. Returns an `IDBRequest` object, in a separate thread, finds all matching values in the referenced object store that correspond to the given key or are in range, if `key` is an `IDBKeyRange`.
  80. **/
  81. function getAll( ?key : Dynamic, ?limit : Int ) : Request;
  82. /** @throws DOMError */
  83. /**
  84. Returns an `IDBRequest` object, in a separate thread, finds all matching keys in the referenced object store that correspond to the given key or are in range, if `key` is an `IDBKeyRange`.
  85. **/
  86. function getAllKeys( ?key : Dynamic, ?limit : Int ) : Request;
  87. }