1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/IndexedDB/#index-interface
10 dictionary IDBIndexParameters {
11 boolean unique = false;
12 boolean multiEntry = false;
13 // <null>: Not locale-aware, uses normal JS sorting.
14 // <string>: Always sorted based on the rules of the specified
15 // locale (e.g. "en-US", etc.).
16 // "auto": Sorted by the platform default, may change based on
17 // user agent options.
18 DOMString? locale = null;
21 [Exposed=(Window,Worker)]
23 [SetterThrows] attribute DOMString name;
24 [SameObject] readonly attribute IDBObjectStore objectStore;
27 readonly attribute any keyPath;
29 readonly attribute boolean multiEntry;
30 readonly attribute boolean unique;
32 // <null>: Not locale-aware, uses normal JS sorting.
33 // <string>: Sorted based on the rules of the specified locale.
34 // Note: never returns "auto", only the current locale.
35 [Pref="dom.indexedDB.experimental"]
36 readonly attribute DOMString? locale;
38 [Pref="dom.indexedDB.experimental"]
39 readonly attribute boolean isAutoLocale;
41 [NewObject, Throws] IDBRequest get(any query);
42 [NewObject, Throws] IDBRequest getKey(any query);
44 // If we decide to add use counters for the mozGetAll/mozGetAllKeys
45 // functions, we'll need to pull them out into sepatate operations
46 // with a BinaryName mapping to the same underlying implementation.
47 // See also bug 1577227.
48 [NewObject, Throws, Alias="mozGetAll"]
49 IDBRequest getAll(optional any query,
50 optional [EnforceRange] unsigned long count);
51 [NewObject, Throws, Alias="mozGetAllKeys"]
52 IDBRequest getAllKeys(optional any query,
53 optional [EnforceRange] unsigned long count);
55 [NewObject, Throws] IDBRequest count(optional any query);
58 IDBRequest openCursor(optional any query,
59 optional IDBCursorDirection direction = "next");
61 IDBRequest openKeyCursor(optional any query,
62 optional IDBCursorDirection direction = "next");