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