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 : Future {
52 // Result becomes an alias for `value`
53 readonly attribute any result;
54 // `error` is no longer needed as it's part of Future.
55 // readonly attribute DOMError error;
57 readonly attribute Object source;
58 readonly attribute IDBTransaction transaction;
59 readonly attribute DOMString readyState;
62 [TreatNonCallableAsNull]
63 attribute Function? onsuccess;
65 [TreatNonCallableAsNull]
66 attribute Function? onerror;
69 IDBRequest implements EventTarget;
71 interface IDBOpenDBRequest : IDBRequest {
72 [TreatNonCallableAsNull]
73 attribute Function? onblocked;
74 [TreatNonCallableAsNull]
75 attribute Function? onupgradeneeded;
79 /**************************************
82 [Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
83 interface IDBVersionChangeEvent : Event {
84 readonly attribute unsigned long long oldVersion;
85 readonly attribute unsigned long long? newVersion;
89 /**************************************
92 Window implements IDBEnvironment;
94 WorkerUtils implements IDBEnvironment;
97 interface IDBEnvironment {
98 readonly attribute IDBFactory indexedDB;
101 interface IDBFactory {
102 IDBOpenDBRequest open (DOMString name, [EnforceRange] optional unsigned long long version);
103 IDBOpenDBRequest deleteDatabase (DOMString name);
104 short cmp (any first, any second);
108 /**************************************
111 interface IDBDatabase : EventTarget {
112 readonly attribute DOMString name;
113 readonly attribute unsigned long long version;
114 readonly attribute DOMStringList objectStoreNames;
115 IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
116 void deleteObjectStore (DOMString name);
117 IDBTransaction transaction (any storeNames, optional DOMString mode);
119 [TreatNonCallableAsNull]
120 attribute Function? onabort;
121 [TreatNonCallableAsNull]
122 attribute Function? onerror;
123 [TreatNonCallableAsNull]
124 attribute Function? onversionchange;
128 /**************************************
131 interface IDBObjectStore {
132 readonly attribute DOMString name;
133 readonly attribute DOMString keyPath;
134 readonly attribute DOMStringList indexNames;
135 readonly attribute IDBTransaction transaction;
136 readonly attribute boolean autoIncremenent;
137 // TODO: that the accept value for a successful put/add is...?
138 IDBRequest put (any value, optional any key);
139 IDBRequest add (any value, optional any key);
140 IDBRequest delete (any key);
141 IDBRequest get (any key);
143 IDBRequest openCursor (optional any? range, optional DOMString direction);
144 IDBIndex createIndex (DOMString name, any keyPath, optional IDBIndexParameters optionalParameters);
145 IDBIndex index (DOMString name);
146 void deleteIndex (DOMString indexName);
147 IDBRequest count (optional any key);
151 /**************************************
155 readonly attribute DOMString name;
156 readonly attribute IDBObjectStore objectStore;
157 readonly attribute DOMString keyPath;
158 readonly attribute boolean multiEntry;
159 readonly attribute boolean unique;
160 IDBRequest openCursor (optional any? range, optional DOMString direction);
161 IDBRequest openKeyCursor (optional any? range, optional DOMString direction);
162 IDBRequest get (any key);
163 IDBRequest getKey (any key);
164 IDBRequest count (optional any key);
168 /**************************************
171 interface IDBCursor {
172 readonly attribute Object source;
173 readonly attribute DOMString direction;
174 readonly attribute any key;
175 readonly attribute any primaryKey;
176 IDBRequest update (any value);
177 void advance ([EnforceRange] unsigned long count);
178 void continue (optional any key);
179 IDBRequest delete ();
182 interface IDBCursorWithValue : IDBCursor {
183 readonly attribute any value;
187 /**************************************
190 interface IDBTransaction : EventTarget {
191 readonly attribute DOMString mode;
192 readonly attribute IDBDatabase db;
193 readonly attribute DOMError error;
194 IDBObjectStore objectStore (DOMString name);
196 [TreatNonCallableAsNull]
197 attribute Function? onabort;
198 [TreatNonCallableAsNull]
199 attribute Function? oncomplete;
200 [TreatNonCallableAsNull]
201 attribute Function? onerror;
206 /**************************************
209 WorkerUtils implements IDBEnvironmentSync;
212 interface IDBEnvironmentSync {
213 readonly attribute IDBFactorySync indexedDBSync;
216 interface IDBFactorySync {
217 IDBDatabaseSync open (DOMString name, [EnforceRange] optional unsigned long long version, optional IDBVersionChangeCallback upgradeCallback, optional unsigned long timeout);
218 void deleteDatabase (DOMString name);
219 short cmp (any first, any second);
223 /**************************************
226 interface IDBDatabaseSync {
227 readonly attribute DOMString name;
228 readonly attribute unsigned long long version;
229 readonly attribute DOMStringList objectStoreNames;
230 IDBObjectStoreSync createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
231 void deleteObjectStore (DOMString name);
232 void transaction (any storeNames, IDBTransactionCallback callback, optional DOMString mode, optional unsigned long timeout);
236 [NoInterfaceObject, Callback]
237 interface IDBTransactionCallback {
238 void transactionStarted (IDBTransactionSync transaction);
241 [NoInterfaceObject, Callback]
242 interface IDBVersionChangeCallback {
243 void transactionStarted (IDBTransactionSync transaction, unsigned long long oldVersion);
247 /**************************************
250 interface IDBObjectStoreSync {
251 readonly attribute DOMString name;
252 readonly attribute any keyPath;
253 readonly attribute DOMStringList indexNames;
254 readonly attribute IDBTransactionSync transaction;
255 readonly attribute boolean autoIncremenent;;
256 any put (any value, optional any key);
257 any add (any value, optional any key);
258 boolean delete (any key);
261 IDBIndexSync createIndex (DOMString name, any keyPath, optional IDBIndexParameters optionalParameters);
262 IDBIndexSync index (DOMString name);
263 void deleteIndex (DOMString indexName);
264 IDBCursorWithValueSync openCursor (optional any? range, optional DOMString direction);
265 unsigned long count (optional any key);
269 /**************************************
272 interface IDBIndexSync {
273 readonly attribute DOMString name;
274 readonly attribute IDBObjectStoreSync objectStore;
275 readonly attribute any keyPath;
276 readonly attribute boolean multiEntry;
277 readonly attribute boolean unique;
278 IDBCursorWithValueSync openCursor (optional any? range, optional DOMString direction);
279 IDBCursorSync openKeyCursor (optional any? range, optional DOMString direction);
281 any getKey (any key);
282 unsigned long count (optional any key);
286 /**************************************
289 interface IDBCursorSync {
290 readonly attribute Object source;
291 readonly attribute DOMString direction;
292 readonly attribute any primaryKey;
293 IDBRequest update (any value);
294 boolean advance ([EnforceRange] unsigned long count);
295 boolean continue (optional any key);
299 interface IDBCursorWithValueSync : IDBCursorSync {
304 /**************************************
307 interface IDBTransactionSync {
308 readonly attribute DOMString mode;
309 attribute IDBDatabaseSync db;
310 readonly attribute DOMError error;
311 IDBObjectStoreSync objectStore (DOMString name);