1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use crate::EventTarget;
use js_sys::Object;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
pub type StorageAreaRead;
#[wasm_bindgen(catch, method, js_name = "getBytesInUse")]
pub async fn get_bytes_in_use(
this: &StorageAreaRead,
keys: &JsValue,
) -> Result<JsValue, JsValue>;
#[wasm_bindgen(catch, method)]
pub async fn get(this: &StorageAreaRead, keys: &JsValue) -> Result<JsValue, JsValue>;
}
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = StorageAreaRead)]
pub type StorageArea;
#[wasm_bindgen(catch, method)]
pub async fn set(this: &StorageArea, keys: &Object) -> Result<JsValue, JsValue>;
#[wasm_bindgen(catch, method)]
pub async fn remove(this: &StorageArea, keys: &JsValue) -> Result<JsValue, JsValue>;
#[wasm_bindgen(catch, method)]
pub async fn clear(this: &StorageArea) -> Result<JsValue, JsValue>;
}
#[wasm_bindgen]
extern "C" {
pub type Storage;
#[wasm_bindgen(method, getter)]
pub fn sync(this: &Storage) -> StorageArea;
#[wasm_bindgen(method, getter)]
pub fn local(this: &Storage) -> StorageArea;
#[wasm_bindgen(method, getter)]
pub fn session(this: &Storage) -> StorageArea;
#[wasm_bindgen(method, getter)]
pub fn managed(this: &Storage) -> StorageAreaRead;
#[wasm_bindgen(method, getter, js_name = onChanged)]
pub fn on_changed(this: &Storage) -> EventTarget;
}
#[wasm_bindgen]
extern "C" {
pub type StorageChange;
#[wasm_bindgen(method, getter, js_name = oldValue)]
pub fn old_value(this: &StorageChange) -> JsValue;
#[wasm_bindgen(method, getter, js_name = newValue)]
pub fn new_value(this: &StorageChange) -> JsValue;
}