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/#object-store-interface
10 dictionary IDBObjectStoreParameters {
11 (DOMString or sequence<DOMString>)? keyPath = null;
12 boolean autoIncrement = false;
15 [Exposed=(Window,Worker)]
16 interface IDBObjectStore {
18 attribute DOMString name;
21 readonly attribute any keyPath;
23 readonly attribute DOMStringList indexNames;
24 [SameObject] readonly attribute IDBTransaction transaction;
25 readonly attribute boolean autoIncrement;
28 IDBRequest put (any value, optional any key);
30 IDBRequest add (any value, optional any key);
32 IDBRequest delete (any key);
36 IDBRequest get (any key);
38 IDBRequest getKey (any key);
40 // Success fires IDBTransactionEvent, result == array of values for given keys
41 // If we decide to add use a counter for the mozGetAll function, we'll need
42 // to pull it out into a sepatate operation with a BinaryName mapping to the
43 // same underlying implementation.
44 [NewObject, Throws, Alias="mozGetAll"]
45 IDBRequest getAll(optional any query,
46 optional [EnforceRange] unsigned long count);
48 IDBRequest getAllKeys(optional any query,
49 optional [EnforceRange] unsigned long count);
52 IDBRequest count(optional any key);
55 IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
57 IDBRequest openKeyCursor(optional any query,
58 optional IDBCursorDirection direction = "next");
60 IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters = {});
63 IDBIndex index (DOMString name);
66 undefined deleteIndex (DOMString indexName);