chrome_types/sys/
storage.rs

1use js_sys::Object;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen]
5extern "C" {
6  pub type Storage;
7
8  #[wasm_bindgen(method, getter)]
9  pub fn local(this: &Storage) -> StorageArea;
10
11  #[wasm_bindgen(method, getter)]
12  pub fn session(this: &Storage) -> StorageArea;
13
14  #[wasm_bindgen(method, getter)]
15  pub fn sync(this: &Storage) -> StorageArea;
16}
17
18#[wasm_bindgen]
19extern "C" {
20  pub type StorageArea;
21
22  #[wasm_bindgen(catch, method)]
23  pub async fn clear(this: &StorageArea) -> Result<JsValue, JsValue>;
24
25  #[wasm_bindgen(catch, method)]
26  pub async fn get(this: &StorageArea, keys: &JsValue) -> Result<JsValue, JsValue>;
27
28  #[wasm_bindgen(catch, method)]
29  pub async fn remove(this: &StorageArea, keys: &JsValue) -> Result<JsValue, JsValue>;
30
31  #[wasm_bindgen(catch, method)]
32  pub async fn set(this: &StorageArea, keys: &Object) -> Result<JsValue, JsValue>;
33}