1 /**************************************
2 * Extracted via the web inspector from:
4 * http://www.w3.org/TR/IndexedDB/
8 * Array.prototype.slice.call(
9 * document.querySelectorAll(".idl,.es-code")
10 * ).map(function(n) { return n.innerText; }).join("\n\n\n");
14 /**************************************
17 interface IDBKeyRange {
18 readonly attribute any lower;
19 readonly attribute any upper;
20 readonly attribute boolean lowerOpen;
21 readonly attribute boolean upperOpen;
22 static IDBKeyRange only (any value);
23 static IDBKeyRange lowerBound (any lower, optional boolean open);
24 static IDBKeyRange upperBound (any upper, optional boolean open);
25 static IDBKeyRange bound (any lower, any upper, optional boolean lowerOpen, optional boolean upperOpen);
29 /**************************************
32 dictionary IDBObjectStoreParameters {
33 DOMString? keyPath = null;
34 boolean autoIncrement = false;
37 dictionary IDBIndexParameters {
38 boolean unique = false;
39 boolean multiEntry = false;
42 dictionary IDBVersionChangeEventInit : EventInit {
43 unsigned long long oldVersion = 0;
44 unsigned long long? newVersion = null;
48 /**************************************
51 interface IDBRequest : EventTarget {
52 readonly attribute any result;
53 readonly attribute DOMError error;
54 readonly attribute Object source;
55 readonly attribute IDBTransaction transaction;
56 readonly attribute DOMString readyState;
57 [TreatNonCallableAsNull]
58 attribute Function? onsuccess;
59 [TreatNonCallableAsNull]
60 attribute Function? onerror;
63 interface IDBOpenDBRequest : IDBRequest {
64 [TreatNonCallableAsNull]
65 attribute Function? onblocked;
66 [TreatNonCallableAsNull]
67 attribute Function? onupgradeneeded;
71 /**************************************
74 [Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
75 interface IDBVersionChangeEvent : Event {
76 readonly attribute unsigned long long oldVersion;
77 readonly attribute unsigned long long? newVersion;
81 /**************************************
84 Window implements IDBEnvironment;
86 WorkerUtils implements IDBEnvironment;
89 interface IDBEnvironment {
90 readonly attribute IDBFactory indexedDB;
93 interface IDBFactory {
94 IDBOpenDBRequest open (DOMString name, [EnforceRange] optional unsigned long long version);
95 IDBOpenDBRequest deleteDatabase (DOMString name);
96 short cmp (any first, any second);
100 /**************************************
103 interface IDBDatabase : EventTarget {
104 readonly attribute DOMString name;
105 readonly attribute unsigned long long version;
106 readonly attribute DOMStringList objectStoreNames;
107 IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
108 void deleteObjectStore (DOMString name);
109 IDBTransaction transaction (any storeNames, optional DOMString mode);
111 [TreatNonCallableAsNull]
112 attribute Function? onabort;
113 [TreatNonCallableAsNull]
114 attribute Function? onerror;
115 [TreatNonCallableAsNull]
116 attribute Function? onversionchange;
120 /**************************************
123 interface IDBObjectStore {
124 readonly attribute DOMString name;
125 readonly attribute DOMString keyPath;
126 readonly attribute DOMStringList indexNames;
127 readonly attribute IDBTransaction transaction;
128 readonly attribute boolean autoIncremenent;;
129 IDBRequest put (any value, optional any key);
130 IDBRequest add (any value, optional any key);
131 IDBRequest delete (any key);
132 IDBRequest get (any key);
134 IDBRequest openCursor (optional any? range, optional DOMString direction);
135 IDBIndex createIndex (DOMString name, any keyPath, optional IDBIndexParameters optionalParameters);
136 IDBIndex index (DOMString name);
137 void deleteIndex (DOMString indexName);
138 IDBRequest count (optional any key);
142 /**************************************
146 readonly attribute DOMString name;
147 readonly attribute IDBObjectStore objectStore;
148 readonly attribute DOMString keyPath;
149 readonly attribute boolean multiEntry;
150 readonly attribute boolean unique;
151 IDBRequest openCursor (optional any? range, optional DOMString direction);
152 IDBRequest openKeyCursor (optional any? range, optional DOMString direction);
153 IDBRequest get (any key);
154 IDBRequest getKey (any key);
155 IDBRequest count (optional any key);
159 /**************************************
162 interface IDBCursor {
163 readonly attribute Object source;
164 readonly attribute DOMString direction;
165 readonly attribute any key;
166 readonly attribute any primaryKey;
167 IDBRequest update (any value);
168 void advance ([EnforceRange] unsigned long count);
169 void continue (optional any key);
170 IDBRequest delete ();
173 interface IDBCursorWithValue : IDBCursor {
174 readonly attribute any value;
178 /**************************************
181 interface IDBTransaction : EventTarget {
182 readonly attribute DOMString mode;
183 readonly attribute IDBDatabase db;
184 readonly attribute DOMError error;
185 IDBObjectStore objectStore (DOMString name);
187 [TreatNonCallableAsNull]
188 attribute Function? onabort;
189 [TreatNonCallableAsNull]
190 attribute Function? oncomplete;
191 [TreatNonCallableAsNull]
192 attribute Function? onerror;
196 /**************************************
199 WorkerUtils implements IDBEnvironmentSync;
202 interface IDBEnvironmentSync {
203 readonly attribute IDBFactorySync indexedDBSync;
206 interface IDBFactorySync {
207 IDBDatabaseSync open (DOMString name, [EnforceRange] optional unsigned long long version, optional IDBVersionChangeCallback upgradeCallback, optional unsigned long timeout);
208 void deleteDatabase (DOMString name);
209 short cmp (any first, any second);
213 /**************************************
216 interface IDBDatabaseSync {
217 readonly attribute DOMString name;
218 readonly attribute unsigned long long version;
219 readonly attribute DOMStringList objectStoreNames;
220 IDBObjectStoreSync createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
221 void deleteObjectStore (DOMString name);
222 void transaction (any storeNames, IDBTransactionCallback callback, optional DOMString mode, optional unsigned long timeout);
226 [NoInterfaceObject, Callback]
227 interface IDBTransactionCallback {
228 void transactionStarted (IDBTransactionSync transaction);
231 [NoInterfaceObject, Callback]
232 interface IDBVersionChangeCallback {
233 void transactionStarted (IDBTransactionSync transaction, unsigned long long oldVersion);
238 /**************************************
241 interface IDBObjectStoreSync {
242 readonly attribute DOMString name;
243 readonly attribute any keyPath;
244 readonly attribute DOMStringList indexNames;
245 readonly attribute IDBTransactionSync transaction;
246 readonly attribute boolean autoIncremenent;;
247 any put (any value, optional any key);
248 any add (any value, optional any key);
249 boolean delete (any key);
252 IDBIndexSync createIndex (DOMString name, any keyPath, optional IDBIndexParameters optionalParameters);
253 IDBIndexSync index (DOMString name);
254 void deleteIndex (DOMString indexName);
255 IDBCursorWithValueSync openCursor (optional any? range, optional DOMString direction);
256 unsigned long count (optional any key);
260 /**************************************
263 interface IDBIndexSync {
264 readonly attribute DOMString name;
265 readonly attribute IDBObjectStoreSync objectStore;
266 readonly attribute any keyPath;
267 readonly attribute boolean multiEntry;
268 readonly attribute boolean unique;
269 IDBCursorWithValueSync openCursor (optional any? range, optional DOMString direction);
270 IDBCursorSync openKeyCursor (optional any? range, optional DOMString direction);
272 any getKey (any key);
273 unsigned long count (optional any key);
277 /**************************************
280 interface IDBCursorSync {
281 readonly attribute Object source;
282 readonly attribute DOMString direction;
283 readonly attribute any primaryKey;
284 IDBRequest update (any value);
285 boolean advance ([EnforceRange] unsigned long count);
286 boolean continue (optional any key);
290 interface IDBCursorWithValueSync : IDBCursorSync {
295 /**************************************
298 interface IDBTransactionSync {
299 readonly attribute DOMString mode;
300 attribute IDBDatabaseSync db;
301 readonly attribute DOMError error;
302 IDBObjectStoreSync objectStore (DOMString name);