maxcountryman_web_sys/features/
gen_Storage.rs

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