Index.hx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (C)2005-2019 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. The name of this index.
  33. **/
  34. var name : String;
  35. /**
  36. The name of the object store referenced by this index.
  37. **/
  38. var objectStore(default,null) : ObjectStore;
  39. /**
  40. The key path of this index. If null, this index is not auto-populated.
  41. **/
  42. var keyPath(default,null) : Dynamic;
  43. /**
  44. 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.
  45. **/
  46. var multiEntry(default,null) : Bool;
  47. /**
  48. If `true`, this index does not allow duplicate values for a key.
  49. **/
  50. var unique(default,null) : Bool;
  51. /**
  52. Returns an `IDBRequest` object, and, in a separate thread, creates a cursor over the specified key range.
  53. @throws DOMError
  54. **/
  55. function openCursor( ?range : Dynamic, direction : CursorDirection = NEXT ) : Request;
  56. /**
  57. Returns an `IDBRequest` object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index.
  58. @throws DOMError
  59. **/
  60. function openKeyCursor( ?range : Dynamic, direction : CursorDirection = NEXT ) : Request;
  61. /**
  62. 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`.
  63. @throws DOMError
  64. **/
  65. function get( key : Dynamic ) : Request;
  66. /**
  67. Returns an `IDBRequest` object, and, in a separate thread, finds either the given key or the primary key, if `key` is an `IDBKeyRange`.
  68. @throws DOMError
  69. **/
  70. function getKey( key : Dynamic ) : Request;
  71. /**
  72. Returns an `IDBRequest` object, and in a separate thread, returns the number of records within a key range.
  73. @throws DOMError
  74. **/
  75. function count( ?key : Dynamic ) : Request;
  76. /**
  77. 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`.
  78. @throws DOMError
  79. **/
  80. function getAll( ?key : Dynamic, ?limit : Int ) : Request;
  81. /**
  82. 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`.
  83. @throws DOMError
  84. **/
  85. function getAllKeys( ?key : Dynamic, ?limit : Int ) : Request;
  86. }