web_sys/features/
gen_StorageEventInit.rs

1#![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 = StorageEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `StorageEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
12    pub type StorageEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &StorageEventInit) -> Option<bool>;
18    #[doc = "Change the `bubbles` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &StorageEventInit, val: bool);
23    #[doc = "Get the `cancelable` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &StorageEventInit) -> Option<bool>;
28    #[doc = "Change the `cancelable` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &StorageEventInit, val: bool);
33    #[doc = "Get the `composed` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &StorageEventInit) -> Option<bool>;
38    #[doc = "Change the `composed` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &StorageEventInit, val: bool);
43    #[doc = "Get the `key` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
46    #[wasm_bindgen(method, getter = "key")]
47    pub fn get_key(this: &StorageEventInit) -> Option<::alloc::string::String>;
48    #[doc = "Change the `key` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
51    #[wasm_bindgen(method, setter = "key")]
52    pub fn set_key(this: &StorageEventInit, val: Option<&str>);
53    #[doc = "Get the `newValue` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
56    #[wasm_bindgen(method, getter = "newValue")]
57    pub fn get_new_value(this: &StorageEventInit) -> Option<::alloc::string::String>;
58    #[doc = "Change the `newValue` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
61    #[wasm_bindgen(method, setter = "newValue")]
62    pub fn set_new_value(this: &StorageEventInit, val: Option<&str>);
63    #[doc = "Get the `oldValue` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
66    #[wasm_bindgen(method, getter = "oldValue")]
67    pub fn get_old_value(this: &StorageEventInit) -> Option<::alloc::string::String>;
68    #[doc = "Change the `oldValue` field of this object."]
69    #[doc = ""]
70    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
71    #[wasm_bindgen(method, setter = "oldValue")]
72    pub fn set_old_value(this: &StorageEventInit, val: Option<&str>);
73    #[cfg(feature = "Storage")]
74    #[doc = "Get the `storageArea` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `Storage`, `StorageEventInit`*"]
77    #[wasm_bindgen(method, getter = "storageArea")]
78    pub fn get_storage_area(this: &StorageEventInit) -> Option<Storage>;
79    #[cfg(feature = "Storage")]
80    #[doc = "Change the `storageArea` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `Storage`, `StorageEventInit`*"]
83    #[wasm_bindgen(method, setter = "storageArea")]
84    pub fn set_storage_area(this: &StorageEventInit, val: Option<&Storage>);
85    #[doc = "Get the `url` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
88    #[wasm_bindgen(method, getter = "url")]
89    pub fn get_url(this: &StorageEventInit) -> Option<::alloc::string::String>;
90    #[doc = "Change the `url` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
93    #[wasm_bindgen(method, setter = "url")]
94    pub fn set_url(this: &StorageEventInit, val: &str);
95}
96impl StorageEventInit {
97    #[doc = "Construct a new `StorageEventInit`."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"]
100    pub fn new() -> Self {
101        #[allow(unused_mut)]
102        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
103        ret
104    }
105    #[deprecated = "Use `set_bubbles()` instead."]
106    pub fn bubbles(&mut self, val: bool) -> &mut Self {
107        self.set_bubbles(val);
108        self
109    }
110    #[deprecated = "Use `set_cancelable()` instead."]
111    pub fn cancelable(&mut self, val: bool) -> &mut Self {
112        self.set_cancelable(val);
113        self
114    }
115    #[deprecated = "Use `set_composed()` instead."]
116    pub fn composed(&mut self, val: bool) -> &mut Self {
117        self.set_composed(val);
118        self
119    }
120    #[deprecated = "Use `set_key()` instead."]
121    pub fn key(&mut self, val: Option<&str>) -> &mut Self {
122        self.set_key(val);
123        self
124    }
125    #[deprecated = "Use `set_new_value()` instead."]
126    pub fn new_value(&mut self, val: Option<&str>) -> &mut Self {
127        self.set_new_value(val);
128        self
129    }
130    #[deprecated = "Use `set_old_value()` instead."]
131    pub fn old_value(&mut self, val: Option<&str>) -> &mut Self {
132        self.set_old_value(val);
133        self
134    }
135    #[cfg(feature = "Storage")]
136    #[deprecated = "Use `set_storage_area()` instead."]
137    pub fn storage_area(&mut self, val: Option<&Storage>) -> &mut Self {
138        self.set_storage_area(val);
139        self
140    }
141    #[deprecated = "Use `set_url()` instead."]
142    pub fn url(&mut self, val: &str) -> &mut Self {
143        self.set_url(val);
144        self
145    }
146}
147impl Default for StorageEventInit {
148    fn default() -> Self {
149        Self::new()
150    }
151}