2013-07-31 08:48:36 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStore
|
|
|
|
*/
|
|
|
|
|
2013-07-31 08:48:46 -07:00
|
|
|
dictionary IDBObjectStoreParameters {
|
|
|
|
// TODO (DOMString or sequence<DOMString>)? keyPath = null;
|
|
|
|
any keyPath = null;
|
|
|
|
boolean autoIncrement = false;
|
|
|
|
};
|
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
interface IDBObjectStore {
|
|
|
|
readonly attribute DOMString name;
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
readonly attribute any keyPath;
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
readonly attribute DOMStringList indexNames;
|
|
|
|
readonly attribute IDBTransaction transaction;
|
|
|
|
readonly attribute boolean autoIncrement;
|
|
|
|
|
|
|
|
[Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest put (any value, any key);
|
2013-07-31 08:48:36 -07:00
|
|
|
|
|
|
|
[Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest add (any value, any key);
|
2013-07-31 08:48:36 -07:00
|
|
|
|
|
|
|
[Throws]
|
|
|
|
IDBRequest delete (any key);
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
IDBRequest get (any key);
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
IDBRequest clear ();
|
|
|
|
|
|
|
|
[Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest openCursor (any range, optional IDBCursorDirection direction = "next");
|
2013-07-31 08:48:36 -07:00
|
|
|
|
|
|
|
// Bug 899972
|
|
|
|
// IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters);
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
IDBIndex createIndex (DOMString name, DOMString keyPath, optional IDBIndexParameters optionalParameters);
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
IDBIndex createIndex (DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters optionalParameters);
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
IDBIndex index (DOMString name);
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
void deleteIndex (DOMString indexName);
|
|
|
|
|
|
|
|
[Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest count (any key);
|
2013-07-31 08:48:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
partial interface IDBObjectStore {
|
|
|
|
// Success fires IDBTransactionEvent, result == array of values for given keys
|
|
|
|
[Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest mozGetAll (any key, optional unsigned long limit);
|
2013-09-24 10:14:16 -07:00
|
|
|
|
|
|
|
[Pref="dom.indexedDB.experimental", Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest getAll (any key, optional unsigned long limit);
|
2013-09-24 10:14:16 -07:00
|
|
|
|
|
|
|
[Pref="dom.indexedDB.experimental", Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest getAllKeys (any key, optional unsigned long limit);
|
2013-09-25 16:11:47 -07:00
|
|
|
|
|
|
|
[Pref="dom.indexedDB.experimental", Throws]
|
2014-02-19 07:13:38 -08:00
|
|
|
IDBRequest openKeyCursor (any range, optional IDBCursorDirection direction = "next");
|
2013-07-31 08:48:36 -07:00
|
|
|
};
|