Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | * |
michael@0 | 6 | * The origin of this IDL file is |
michael@0 | 7 | * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStore |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | dictionary IDBObjectStoreParameters { |
michael@0 | 11 | // TODO (DOMString or sequence<DOMString>)? keyPath = null; |
michael@0 | 12 | any keyPath = null; |
michael@0 | 13 | boolean autoIncrement = false; |
michael@0 | 14 | }; |
michael@0 | 15 | |
michael@0 | 16 | interface IDBObjectStore { |
michael@0 | 17 | readonly attribute DOMString name; |
michael@0 | 18 | |
michael@0 | 19 | [Throws] |
michael@0 | 20 | readonly attribute any keyPath; |
michael@0 | 21 | |
michael@0 | 22 | [Throws] |
michael@0 | 23 | readonly attribute DOMStringList indexNames; |
michael@0 | 24 | readonly attribute IDBTransaction transaction; |
michael@0 | 25 | readonly attribute boolean autoIncrement; |
michael@0 | 26 | |
michael@0 | 27 | [Throws] |
michael@0 | 28 | IDBRequest put (any value, optional any key); |
michael@0 | 29 | |
michael@0 | 30 | [Throws] |
michael@0 | 31 | IDBRequest add (any value, optional any key); |
michael@0 | 32 | |
michael@0 | 33 | [Throws] |
michael@0 | 34 | IDBRequest delete (any key); |
michael@0 | 35 | |
michael@0 | 36 | [Throws] |
michael@0 | 37 | IDBRequest get (any key); |
michael@0 | 38 | |
michael@0 | 39 | [Throws] |
michael@0 | 40 | IDBRequest clear (); |
michael@0 | 41 | |
michael@0 | 42 | [Throws] |
michael@0 | 43 | IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next"); |
michael@0 | 44 | |
michael@0 | 45 | // Bug 899972 |
michael@0 | 46 | // IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters); |
michael@0 | 47 | |
michael@0 | 48 | [Throws] |
michael@0 | 49 | IDBIndex createIndex (DOMString name, DOMString keyPath, optional IDBIndexParameters optionalParameters); |
michael@0 | 50 | |
michael@0 | 51 | [Throws] |
michael@0 | 52 | IDBIndex createIndex (DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters optionalParameters); |
michael@0 | 53 | |
michael@0 | 54 | [Throws] |
michael@0 | 55 | IDBIndex index (DOMString name); |
michael@0 | 56 | |
michael@0 | 57 | [Throws] |
michael@0 | 58 | void deleteIndex (DOMString indexName); |
michael@0 | 59 | |
michael@0 | 60 | [Throws] |
michael@0 | 61 | IDBRequest count (optional any key); |
michael@0 | 62 | }; |
michael@0 | 63 | |
michael@0 | 64 | partial interface IDBObjectStore { |
michael@0 | 65 | // Success fires IDBTransactionEvent, result == array of values for given keys |
michael@0 | 66 | [Throws] |
michael@0 | 67 | IDBRequest mozGetAll (optional any key, optional unsigned long limit); |
michael@0 | 68 | |
michael@0 | 69 | [Pref="dom.indexedDB.experimental", Throws] |
michael@0 | 70 | IDBRequest getAll (optional any key, optional unsigned long limit); |
michael@0 | 71 | |
michael@0 | 72 | [Pref="dom.indexedDB.experimental", Throws] |
michael@0 | 73 | IDBRequest getAllKeys (optional any key, optional unsigned long limit); |
michael@0 | 74 | |
michael@0 | 75 | [Pref="dom.indexedDB.experimental", Throws] |
michael@0 | 76 | IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next"); |
michael@0 | 77 | }; |