Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / third_party / Promises / reworked_APIs / IndexedDB / before.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 : 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;
61 };
62
63 interface IDBOpenDBRequest : IDBRequest {
64     [TreatNonCallableAsNull]
65     attribute Function? onblocked;
66     [TreatNonCallableAsNull]
67     attribute Function? onupgradeneeded;
68 };
69
70
71 /**************************************
72  * 3.2.2
73  **/
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;
78 };
79
80
81 /**************************************
82  * 3.2.3
83  **/
84 Window implements IDBEnvironment;
85
86 WorkerUtils implements IDBEnvironment;
87
88 [NoInterfaceObject]
89 interface IDBEnvironment {
90     readonly attribute IDBFactory indexedDB;
91 };
92
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);
97 };
98
99
100 /**************************************
101  * 3.2.4
102  **/
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);
110     void           close ();
111     [TreatNonCallableAsNull]
112              attribute Function?          onabort;
113     [TreatNonCallableAsNull]
114              attribute Function?          onerror;
115     [TreatNonCallableAsNull]
116              attribute Function?          onversionchange;
117 };
118
119
120 /**************************************
121  * 3.2.5
122  **/
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);
133     IDBRequest clear ();
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);
139 };
140
141
142 /**************************************
143  * 3.2.6
144  **/
145 interface IDBIndex {
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);
156 };
157
158
159 /**************************************
160  * 3.2.7
161  **/
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 ();
171 };
172
173 interface IDBCursorWithValue : IDBCursor {
174     readonly attribute any value;
175 };
176
177
178 /**************************************
179  * 3.2.8
180  **/
181 interface IDBTransaction : EventTarget {
182     readonly attribute DOMString   mode;
183     readonly attribute IDBDatabase db;
184     readonly attribute DOMError    error;
185     IDBObjectStore objectStore (DOMString name);
186     void           abort ();
187     [TreatNonCallableAsNull]
188              attribute Function?   onabort;
189     [TreatNonCallableAsNull]
190              attribute Function?   oncomplete;
191     [TreatNonCallableAsNull]
192              attribute Function?   onerror;
193 };
194
195
196 /**************************************
197  * 3.3.1
198  **/
199 WorkerUtils implements IDBEnvironmentSync;
200
201 [NoInterfaceObject]
202 interface IDBEnvironmentSync {
203     readonly attribute IDBFactorySync indexedDBSync;
204 };
205
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);
210 };
211
212
213 /**************************************
214  * 3.3.2
215  **/
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);
223     void               close ();
224 };
225
226 [NoInterfaceObject, Callback]
227 interface IDBTransactionCallback {
228     void transactionStarted (IDBTransactionSync transaction);
229 };
230
231 [NoInterfaceObject, Callback]
232 interface IDBVersionChangeCallback {
233     void transactionStarted (IDBTransactionSync transaction, unsigned long long oldVersion);
234 };
235
236
237
238 /**************************************
239  * 3.3.3
240  **/
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);
250     any                    get (any key);
251     void                   clear ();
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);
257 };
258
259
260 /**************************************
261  * 3.3.4
262  **/
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);
271     any                    get (any key);
272     any                    getKey (any key);
273     unsigned long          count (optional any key);
274 };
275
276
277 /**************************************
278  * 3.3.5
279  **/
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);
287     boolean    delete ();
288 };
289
290 interface IDBCursorWithValueSync : IDBCursorSync {
291     attribute any value;
292 };
293
294
295 /**************************************
296  * 3.3.6
297  **/
298 interface IDBTransactionSync {
299     readonly attribute DOMString       mode;
300              attribute IDBDatabaseSync db;
301     readonly attribute DOMError        error;
302     IDBObjectStoreSync objectStore (DOMString name);
303     void               abort ();
304 };