Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / third_party / Promises / reworked_APIs / IndexedDB / after.idl
1 /**************************************
2  * Extracted via the web inspector from:
3  *
4  *    http://www.w3.org/TR/IndexedDB/
5  *
6  * By running:
7  *
8  *    Array.prototype.slice.call(
9  *      document.querySelectorAll(".idl,.es-code")
10  *    ).map(function(n) { return n.innerText; }).join("\n\n\n");
11  *
12  **/
13
14 /**************************************
15  * 3.1.9
16  **/
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);
26 };
27
28
29 /**************************************
30  * 3.1.12
31  **/
32 dictionary IDBObjectStoreParameters {
33   DOMString? keyPath = null;
34   boolean autoIncrement = false;
35 };
36
37 dictionary IDBIndexParameters {
38   boolean unique = false;
39   boolean multiEntry = false;
40 };
41
42 dictionary IDBVersionChangeEventInit : EventInit {
43   unsigned long long oldVersion = 0;
44   unsigned long long? newVersion = null;
45 };
46
47
48 /**************************************
49  * 3.2.1
50  **/
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;
56
57     readonly attribute Object         source;
58     readonly attribute IDBTransaction transaction;
59     readonly attribute DOMString      readyState;
60
61     // Alias for onaccept
62     [TreatNonCallableAsNull]
63              attribute Function?      onsuccess;
64     // Alias for onreject
65     [TreatNonCallableAsNull]
66              attribute Function?      onerror;
67 };
68
69 IDBRequest implements EventTarget;
70
71 interface IDBOpenDBRequest : IDBRequest {
72     [TreatNonCallableAsNull]
73     attribute Function? onblocked;
74     [TreatNonCallableAsNull]
75     attribute Function? onupgradeneeded;
76 };
77
78
79 /**************************************
80  * 3.2.2
81  **/
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;
86 };
87
88
89 /**************************************
90  * 3.2.3
91  **/
92 Window implements IDBEnvironment;
93
94 WorkerUtils implements IDBEnvironment;
95
96 [NoInterfaceObject]
97 interface IDBEnvironment {
98     readonly attribute IDBFactory indexedDB;
99 };
100
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);
105 };
106
107
108 /**************************************
109  * 3.2.4
110  **/
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);
118     void           close ();
119     [TreatNonCallableAsNull]
120              attribute Function?          onabort;
121     [TreatNonCallableAsNull]
122              attribute Function?          onerror;
123     [TreatNonCallableAsNull]
124              attribute Function?          onversionchange;
125 };
126
127
128 /**************************************
129  * 3.2.5
130  **/
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);
142     IDBRequest clear ();
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);
148 };
149
150
151 /**************************************
152  * 3.2.6
153  **/
154 interface IDBIndex {
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);
165 };
166
167
168 /**************************************
169  * 3.2.7
170  **/
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 ();
180 };
181
182 interface IDBCursorWithValue : IDBCursor {
183     readonly attribute any value;
184 };
185
186
187 /**************************************
188  * 3.2.8
189  **/
190 interface IDBTransaction : EventTarget {
191     readonly attribute DOMString   mode;
192     readonly attribute IDBDatabase db;
193     readonly attribute DOMError    error;
194     IDBObjectStore objectStore (DOMString name);
195     void           abort ();
196     [TreatNonCallableAsNull]
197              attribute Function?   onabort;
198     [TreatNonCallableAsNull]
199              attribute Function?   oncomplete;
200     [TreatNonCallableAsNull]
201              attribute Function?   onerror;
202     IDBRequest     open();
203 };
204
205
206 /**************************************
207  * 3.3.1
208  **/
209 WorkerUtils implements IDBEnvironmentSync;
210
211 [NoInterfaceObject]
212 interface IDBEnvironmentSync {
213     readonly attribute IDBFactorySync indexedDBSync;
214 };
215
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);
220 };
221
222
223 /**************************************
224  * 3.3.2
225  **/
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);
233     void               close ();
234 };
235
236 [NoInterfaceObject, Callback]
237 interface IDBTransactionCallback {
238     void transactionStarted (IDBTransactionSync transaction);
239 };
240
241 [NoInterfaceObject, Callback]
242 interface IDBVersionChangeCallback {
243     void transactionStarted (IDBTransactionSync transaction, unsigned long long oldVersion);
244 };
245
246
247 /**************************************
248  * 3.3.3
249  **/
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);
259     any                    get (any key);
260     void                   clear ();
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);
266 };
267
268
269 /**************************************
270  * 3.3.4
271  **/
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);
280     any                    get (any key);
281     any                    getKey (any key);
282     unsigned long          count (optional any key);
283 };
284
285
286 /**************************************
287  * 3.3.5
288  **/
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);
296     boolean    delete ();
297 };
298
299 interface IDBCursorWithValueSync : IDBCursorSync {
300     attribute any value;
301 };
302
303
304 /**************************************
305  * 3.3.6
306  **/
307 interface IDBTransactionSync {
308     readonly attribute DOMString       mode;
309              attribute IDBDatabaseSync db;
310     readonly attribute DOMError        error;
311     IDBObjectStoreSync objectStore (DOMString name);
312     void               abort ();
313 };