// https://dvcs.w3.org/hg/IndexedDB/raw-file/default/Overview.html#idl-def-IDBObjectStore
+// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+enum IDBCursorDirection {
+ "next",
+ "nextunique",
+ "prev",
+ "prevunique"
+};
+
[
GarbageCollected,
] interface IDBObjectStore {
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString name;
+ readonly attribute DOMString? name;
[CallWith=ScriptState] readonly attribute any keyPath;
readonly attribute DOMStringList indexNames;
readonly attribute IDBTransaction transaction;
[CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete(any key);
[CallWith=ScriptState, RaisesException] IDBRequest get(any key);
[CallWith=ScriptState, RaisesException] IDBRequest clear();
- [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional DOMString direction = null);
- [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional DOMString direction = null);
+ [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional DOMString direction = "next");
+ [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
// FIXME: should be union type http://crbug.com/240176
[CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, DOMString keyPath, optional Dictionary options);
[CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, sequence<DOMString> keyPath, optional Dictionary options);