|
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/. |
|
5 * |
|
6 * The origin of this IDL file is |
|
7 * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStore |
|
8 */ |
|
9 |
|
10 dictionary IDBObjectStoreParameters { |
|
11 // TODO (DOMString or sequence<DOMString>)? keyPath = null; |
|
12 any keyPath = null; |
|
13 boolean autoIncrement = false; |
|
14 }; |
|
15 |
|
16 interface IDBObjectStore { |
|
17 readonly attribute DOMString name; |
|
18 |
|
19 [Throws] |
|
20 readonly attribute any keyPath; |
|
21 |
|
22 [Throws] |
|
23 readonly attribute DOMStringList indexNames; |
|
24 readonly attribute IDBTransaction transaction; |
|
25 readonly attribute boolean autoIncrement; |
|
26 |
|
27 [Throws] |
|
28 IDBRequest put (any value, optional any key); |
|
29 |
|
30 [Throws] |
|
31 IDBRequest add (any value, optional any key); |
|
32 |
|
33 [Throws] |
|
34 IDBRequest delete (any key); |
|
35 |
|
36 [Throws] |
|
37 IDBRequest get (any key); |
|
38 |
|
39 [Throws] |
|
40 IDBRequest clear (); |
|
41 |
|
42 [Throws] |
|
43 IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next"); |
|
44 |
|
45 // Bug 899972 |
|
46 // IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters); |
|
47 |
|
48 [Throws] |
|
49 IDBIndex createIndex (DOMString name, DOMString keyPath, optional IDBIndexParameters optionalParameters); |
|
50 |
|
51 [Throws] |
|
52 IDBIndex createIndex (DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters optionalParameters); |
|
53 |
|
54 [Throws] |
|
55 IDBIndex index (DOMString name); |
|
56 |
|
57 [Throws] |
|
58 void deleteIndex (DOMString indexName); |
|
59 |
|
60 [Throws] |
|
61 IDBRequest count (optional any key); |
|
62 }; |
|
63 |
|
64 partial interface IDBObjectStore { |
|
65 // Success fires IDBTransactionEvent, result == array of values for given keys |
|
66 [Throws] |
|
67 IDBRequest mozGetAll (optional any key, optional unsigned long limit); |
|
68 |
|
69 [Pref="dom.indexedDB.experimental", Throws] |
|
70 IDBRequest getAll (optional any key, optional unsigned long limit); |
|
71 |
|
72 [Pref="dom.indexedDB.experimental", Throws] |
|
73 IDBRequest getAllKeys (optional any key, optional unsigned long limit); |
|
74 |
|
75 [Pref="dom.indexedDB.experimental", Throws] |
|
76 IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next"); |
|
77 }; |