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