Skip to main content

web_sys/features/
gen_ToggleEventInit.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 = "ToggleEventInit")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ToggleEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
12    pub type ToggleEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &ToggleEventInit) -> 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: `ToggleEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &ToggleEventInit, 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: `ToggleEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &ToggleEventInit) -> 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: `ToggleEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &ToggleEventInit, 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: `ToggleEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &ToggleEventInit) -> 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: `ToggleEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &ToggleEventInit, val: bool);
43    #[doc = "Get the `newState` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
46    #[wasm_bindgen(method, getter = "newState")]
47    pub fn get_new_state(this: &ToggleEventInit) -> Option<::alloc::string::String>;
48    #[doc = "Change the `newState` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
51    #[wasm_bindgen(method, setter = "newState")]
52    pub fn set_new_state(this: &ToggleEventInit, val: &str);
53    #[doc = "Get the `oldState` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
56    #[wasm_bindgen(method, getter = "oldState")]
57    pub fn get_old_state(this: &ToggleEventInit) -> Option<::alloc::string::String>;
58    #[doc = "Change the `oldState` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
61    #[wasm_bindgen(method, setter = "oldState")]
62    pub fn set_old_state(this: &ToggleEventInit, val: &str);
63    #[cfg(feature = "Element")]
64    #[doc = "Get the `source` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `Element`, `ToggleEventInit`*"]
67    #[wasm_bindgen(method, getter = "source")]
68    pub fn get_source(this: &ToggleEventInit) -> Option<Element>;
69    #[cfg(feature = "Element")]
70    #[doc = "Change the `source` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `Element`, `ToggleEventInit`*"]
73    #[wasm_bindgen(method, setter = "source")]
74    pub fn set_source(this: &ToggleEventInit, val: Option<&Element>);
75}
76impl ToggleEventInit {
77    #[doc = "Construct a new `ToggleEventInit`."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"]
80    pub fn new() -> Self {
81        #[allow(unused_mut)]
82        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
83        ret
84    }
85    #[deprecated = "Use `set_bubbles()` instead."]
86    pub fn bubbles(&mut self, val: bool) -> &mut Self {
87        self.set_bubbles(val);
88        self
89    }
90    #[deprecated = "Use `set_cancelable()` instead."]
91    pub fn cancelable(&mut self, val: bool) -> &mut Self {
92        self.set_cancelable(val);
93        self
94    }
95    #[deprecated = "Use `set_composed()` instead."]
96    pub fn composed(&mut self, val: bool) -> &mut Self {
97        self.set_composed(val);
98        self
99    }
100    #[deprecated = "Use `set_new_state()` instead."]
101    pub fn new_state(&mut self, val: &str) -> &mut Self {
102        self.set_new_state(val);
103        self
104    }
105    #[deprecated = "Use `set_old_state()` instead."]
106    pub fn old_state(&mut self, val: &str) -> &mut Self {
107        self.set_old_state(val);
108        self
109    }
110    #[cfg(feature = "Element")]
111    #[deprecated = "Use `set_source()` instead."]
112    pub fn source(&mut self, val: Option<&Element>) -> &mut Self {
113        self.set_source(val);
114        self
115    }
116}
117impl Default for ToggleEventInit {
118    fn default() -> Self {
119        Self::new()
120    }
121}