Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / imported / web-platform-tests / IndexedDB / interfaces.idl
blob055e62f46b3de0b3c046f2db1d4725d9ab878f3d
1 enum IDBTransactionMode {
2 "readonly",
3 "readwrite",
4 "versionchange"
5 };
7 enum IDBRequestReadyState {
8 "pending",
9 "done"
12 interface IDBKeyRange {
13 readonly attribute any lower;
14 readonly attribute any upper;
15 readonly attribute boolean lowerOpen;
16 readonly attribute boolean upperOpen;
17 static IDBKeyRange only (any value);
18 static IDBKeyRange lowerBound (any lower, optional boolean open = false);
19 static IDBKeyRange upperBound (any upper, optional boolean open = false);
20 static IDBKeyRange bound (any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
23 enum IDBCursorDirection {
24 "next",
25 "nextunique",
26 "prev",
27 "prevunique"
30 dictionary IDBObjectStoreParameters {
31 (DOMString or sequence<DOMString>)? keyPath = null;
32 boolean autoIncrement = false;
35 dictionary IDBIndexParameters {
36 boolean unique = false;
37 boolean multiEntry = false;
40 dictionary IDBVersionChangeEventInit : EventInit {
41 unsigned long long oldVersion = 0;
42 unsigned long long? newVersion = null;
45 interface IDBRequest : EventTarget {
46 readonly attribute any result;
47 readonly attribute DOMError error;
48 readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
49 readonly attribute IDBTransaction transaction;
50 readonly attribute IDBRequestReadyState readyState;
51 attribute EventHandler onsuccess;
52 attribute EventHandler onerror;
55 interface IDBOpenDBRequest : IDBRequest {
56 attribute EventHandler onblocked;
57 attribute EventHandler onupgradeneeded;
60 [Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
61 interface IDBVersionChangeEvent : Event {
62 readonly attribute unsigned long long oldVersion;
63 readonly attribute unsigned long long? newVersion;
66 [NoInterfaceObject]
67 interface IDBEnvironment {
68 readonly attribute IDBFactory indexedDB;
71 interface IDBFactory {
72 IDBOpenDBRequest open (DOMString name, [EnforceRange] optional unsigned long long version);
73 IDBOpenDBRequest deleteDatabase (DOMString name);
74 short cmp (any first, any second);
77 interface IDBDatabase : EventTarget {
78 readonly attribute DOMString name;
79 readonly attribute unsigned long long version;
80 readonly attribute DOMStringList objectStoreNames;
81 IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
82 void deleteObjectStore (DOMString name);
83 IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames, optional IDBTransactionMode mode = "readonly");
84 void close ();
85 attribute EventHandler onabort;
86 attribute EventHandler onerror;
87 attribute EventHandler onversionchange;
90 interface IDBObjectStore {
91 readonly attribute DOMString name;
92 readonly attribute any keyPath;
93 readonly attribute DOMStringList indexNames;
94 readonly attribute IDBTransaction transaction;
95 readonly attribute boolean autoIncrement;
96 IDBRequest put (any value, optional any key);
97 IDBRequest add (any value, optional any key);
98 IDBRequest delete (any key);
99 IDBRequest get (any key);
100 IDBRequest clear ();
101 IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
102 IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters);
103 IDBIndex index (DOMString name);
104 void deleteIndex (DOMString indexName);
105 IDBRequest count (optional any key);
108 interface IDBIndex {
109 readonly attribute DOMString name;
110 readonly attribute IDBObjectStore objectStore;
111 readonly attribute any keyPath;
112 readonly attribute boolean multiEntry;
113 readonly attribute boolean unique;
114 IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
115 IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
116 IDBRequest get (any key);
117 IDBRequest getKey (any key);
118 IDBRequest count (optional any key);
121 interface IDBCursor {
122 readonly attribute (IDBObjectStore or IDBIndex) source;
123 readonly attribute IDBCursorDirection direction;
124 readonly attribute any key;
125 readonly attribute any primaryKey;
126 IDBRequest update (any value);
127 void advance ([EnforceRange] unsigned long count);
128 void continue (optional any key);
129 IDBRequest delete ();
132 interface IDBCursorWithValue : IDBCursor {
133 readonly attribute any value;
136 interface IDBTransaction : EventTarget {
137 readonly attribute IDBTransactionMode mode;
138 readonly attribute IDBDatabase db;
139 readonly attribute DOMError error;
140 IDBObjectStore objectStore (DOMString name);
141 void abort ();
142 attribute EventHandler onabort;
143 attribute EventHandler oncomplete;
144 attribute EventHandler onerror;