1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/IDBObjectStore.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,77 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * The origin of this IDL file is 1.10 + * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStore 1.11 + */ 1.12 + 1.13 +dictionary IDBObjectStoreParameters { 1.14 + // TODO (DOMString or sequence<DOMString>)? keyPath = null; 1.15 + any keyPath = null; 1.16 + boolean autoIncrement = false; 1.17 +}; 1.18 + 1.19 +interface IDBObjectStore { 1.20 + readonly attribute DOMString name; 1.21 + 1.22 + [Throws] 1.23 + readonly attribute any keyPath; 1.24 + 1.25 + [Throws] 1.26 + readonly attribute DOMStringList indexNames; 1.27 + readonly attribute IDBTransaction transaction; 1.28 + readonly attribute boolean autoIncrement; 1.29 + 1.30 + [Throws] 1.31 + IDBRequest put (any value, optional any key); 1.32 + 1.33 + [Throws] 1.34 + IDBRequest add (any value, optional any key); 1.35 + 1.36 + [Throws] 1.37 + IDBRequest delete (any key); 1.38 + 1.39 + [Throws] 1.40 + IDBRequest get (any key); 1.41 + 1.42 + [Throws] 1.43 + IDBRequest clear (); 1.44 + 1.45 + [Throws] 1.46 + IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next"); 1.47 + 1.48 + // Bug 899972 1.49 + // IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters); 1.50 + 1.51 + [Throws] 1.52 + IDBIndex createIndex (DOMString name, DOMString keyPath, optional IDBIndexParameters optionalParameters); 1.53 + 1.54 + [Throws] 1.55 + IDBIndex createIndex (DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters optionalParameters); 1.56 + 1.57 + [Throws] 1.58 + IDBIndex index (DOMString name); 1.59 + 1.60 + [Throws] 1.61 + void deleteIndex (DOMString indexName); 1.62 + 1.63 + [Throws] 1.64 + IDBRequest count (optional any key); 1.65 +}; 1.66 + 1.67 +partial interface IDBObjectStore { 1.68 + // Success fires IDBTransactionEvent, result == array of values for given keys 1.69 + [Throws] 1.70 + IDBRequest mozGetAll (optional any key, optional unsigned long limit); 1.71 + 1.72 + [Pref="dom.indexedDB.experimental", Throws] 1.73 + IDBRequest getAll (optional any key, optional unsigned long limit); 1.74 + 1.75 + [Pref="dom.indexedDB.experimental", Throws] 1.76 + IDBRequest getAllKeys (optional any key, optional unsigned long limit); 1.77 + 1.78 + [Pref="dom.indexedDB.experimental", Throws] 1.79 + IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next"); 1.80 +};