1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 // TODO Bug 957086 - The DataStoreImpl WebIDL will be removed once the
8 // DataStore API is fully rewritten in C++ (i.e. should be
9 // directly implemented by the DataStore WebIDL).
11 [HeaderFile="mozilla/dom/DataStore.h",
12 Func="mozilla::dom::DataStore::EnabledForScope",
13 JSImplementation="@mozilla.org/dom/datastore-impl;1"]
14 interface DataStoreImpl {
15 void setEventTarget(EventTarget eventTarget);
17 // Returns the label of the DataSource.
18 readonly attribute DOMString name;
20 // Returns the origin of the DataSource (e.g., 'facebook.com').
21 // This value is the manifest URL of the owner app.
22 readonly attribute DOMString owner;
24 // is readOnly a F(current_app, datastore) function? yes
25 readonly attribute boolean readOnly;
27 Promise<any> get(DataStoreKey... id);
29 Promise<void> put(any obj, DataStoreKey id, optional DOMString revisionId = "");
31 Promise<DataStoreKey> add(any obj, optional DataStoreKey id,
32 optional DOMString revisionId = "");
34 Promise<boolean> remove(DataStoreKey id, optional DOMString revisionId = "");
36 Promise<void> clear(optional DOMString revisionId = "");
38 readonly attribute DOMString revisionId;
40 Promise<unsigned long> getLength();
43 DataStoreCursor sync(optional DOMString revisionId = "");
47 // TODO Bug 957086 - The DataStoreCursorImpl WebIDL will be removed once the
48 // DataStore API is fully rewritten in C++ (i.e. should be
49 // directly implemented by the DataStoreCursor WebIDL).
51 [HeaderFile="mozilla/dom/DataStore.h",
52 Func="mozilla::dom::DataStore::EnabledForScope",
53 JSImplementation="@mozilla.org/dom/datastore-cursor-impl;1"]
54 interface DataStoreCursorImpl {
56 readonly attribute DataStore store;
58 Promise<DataStoreTask> next();