web_sys/features/
gen_Storage.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Storage , typescript_type = "Storage")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `Storage` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
14 pub type Storage;
15 # [wasm_bindgen (structural , catch , method , getter , js_class = "Storage" , js_name = length)]
16 #[doc = "Getter for the `length` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/length)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
21 pub fn length(this: &Storage) -> Result<u32, JsValue>;
22 # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = clear)]
23 #[doc = "The `clear()` method."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/clear)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
28 pub fn clear(this: &Storage) -> Result<(), JsValue>;
29 # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = getItem)]
30 #[doc = "The `getItem()` method."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
35 pub fn get_item(this: &Storage, key: &str) -> Result<Option<::alloc::string::String>, JsValue>;
36 # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = key)]
37 #[doc = "The `key()` method."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/key)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
42 pub fn key(this: &Storage, index: u32) -> Result<Option<::alloc::string::String>, JsValue>;
43 # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = removeItem)]
44 #[doc = "The `removeItem()` method."]
45 #[doc = ""]
46 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/removeItem)"]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
49 pub fn remove_item(this: &Storage, key: &str) -> Result<(), JsValue>;
50 # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = setItem)]
51 #[doc = "The `setItem()` method."]
52 #[doc = ""]
53 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem)"]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
56 pub fn set_item(this: &Storage, key: &str, value: &str) -> Result<(), JsValue>;
57 #[wasm_bindgen(catch, method, structural, js_class = "Storage", indexing_getter)]
58 #[doc = "Indexing getter. As in the literal Javascript `this[key]`."]
59 #[doc = ""]
60 #[doc = ""]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
63 pub fn get(this: &Storage, key: &str) -> Result<Option<::alloc::string::String>, JsValue>;
64 #[wasm_bindgen(catch, method, structural, js_class = "Storage", indexing_setter)]
65 #[doc = "Indexing setter. As in the literal Javascript `this[key] = value`."]
66 #[doc = ""]
67 #[doc = ""]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
70 pub fn set(this: &Storage, key: &str, value: &str) -> Result<(), JsValue>;
71 #[wasm_bindgen(catch, method, structural, js_class = "Storage", indexing_deleter)]
72 #[doc = "Indexing deleter. As in the literal Javascript `delete this[key]`."]
73 #[doc = ""]
74 #[doc = ""]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `Storage`*"]
77 pub fn delete(this: &Storage, key: &str) -> Result<(), JsValue>;
78}