web_sys/features/
gen_InputEventInit.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 = InputEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `InputEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
12 pub type InputEventInit;
13 #[doc = "Get the `bubbles` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
16 #[wasm_bindgen(method, getter = "bubbles")]
17 pub fn get_bubbles(this: &InputEventInit) -> 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: `InputEventInit`*"]
21 #[wasm_bindgen(method, setter = "bubbles")]
22 pub fn set_bubbles(this: &InputEventInit, 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: `InputEventInit`*"]
26 #[wasm_bindgen(method, getter = "cancelable")]
27 pub fn get_cancelable(this: &InputEventInit) -> 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: `InputEventInit`*"]
31 #[wasm_bindgen(method, setter = "cancelable")]
32 pub fn set_cancelable(this: &InputEventInit, 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: `InputEventInit`*"]
36 #[wasm_bindgen(method, getter = "composed")]
37 pub fn get_composed(this: &InputEventInit) -> 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: `InputEventInit`*"]
41 #[wasm_bindgen(method, setter = "composed")]
42 pub fn set_composed(this: &InputEventInit, 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: `InputEventInit`*"]
46 #[wasm_bindgen(method, getter = "detail")]
47 pub fn get_detail(this: &InputEventInit) -> 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: `InputEventInit`*"]
51 #[wasm_bindgen(method, setter = "detail")]
52 pub fn set_detail(this: &InputEventInit, 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: `InputEventInit`, `Window`*"]
57 #[wasm_bindgen(method, getter = "view")]
58 pub fn get_view(this: &InputEventInit) -> 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: `InputEventInit`, `Window`*"]
63 #[wasm_bindgen(method, setter = "view")]
64 pub fn set_view(this: &InputEventInit, val: Option<&Window>);
65 #[doc = "Get the `data` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
68 #[wasm_bindgen(method, getter = "data")]
69 pub fn get_data(this: &InputEventInit) -> Option<::alloc::string::String>;
70 #[doc = "Change the `data` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
73 #[wasm_bindgen(method, setter = "data")]
74 pub fn set_data(this: &InputEventInit, val: Option<&str>);
75 #[cfg(feature = "DataTransfer")]
76 #[doc = "Get the `dataTransfer` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `InputEventInit`*"]
79 #[wasm_bindgen(method, getter = "dataTransfer")]
80 pub fn get_data_transfer(this: &InputEventInit) -> Option<DataTransfer>;
81 #[cfg(feature = "DataTransfer")]
82 #[doc = "Change the `dataTransfer` field of this object."]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `InputEventInit`*"]
85 #[wasm_bindgen(method, setter = "dataTransfer")]
86 pub fn set_data_transfer(this: &InputEventInit, val: Option<&DataTransfer>);
87 #[doc = "Get the `inputType` field of this object."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
90 #[wasm_bindgen(method, getter = "inputType")]
91 pub fn get_input_type(this: &InputEventInit) -> Option<::alloc::string::String>;
92 #[doc = "Change the `inputType` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
95 #[wasm_bindgen(method, setter = "inputType")]
96 pub fn set_input_type(this: &InputEventInit, val: &str);
97 #[doc = "Get the `isComposing` field of this object."]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
100 #[wasm_bindgen(method, getter = "isComposing")]
101 pub fn get_is_composing(this: &InputEventInit) -> Option<bool>;
102 #[doc = "Change the `isComposing` field of this object."]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
105 #[wasm_bindgen(method, setter = "isComposing")]
106 pub fn set_is_composing(this: &InputEventInit, val: bool);
107 #[doc = "Get the `targetRanges` field of this object."]
108 #[doc = ""]
109 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
110 #[wasm_bindgen(method, getter = "targetRanges")]
111 pub fn get_target_ranges(this: &InputEventInit) -> Option<::js_sys::Array>;
112 #[doc = "Change the `targetRanges` field of this object."]
113 #[doc = ""]
114 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
115 #[wasm_bindgen(method, setter = "targetRanges")]
116 pub fn set_target_ranges(this: &InputEventInit, val: &::wasm_bindgen::JsValue);
117}
118impl InputEventInit {
119 #[doc = "Construct a new `InputEventInit`."]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"]
122 pub fn new() -> Self {
123 #[allow(unused_mut)]
124 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
125 ret
126 }
127 #[deprecated = "Use `set_bubbles()` instead."]
128 pub fn bubbles(&mut self, val: bool) -> &mut Self {
129 self.set_bubbles(val);
130 self
131 }
132 #[deprecated = "Use `set_cancelable()` instead."]
133 pub fn cancelable(&mut self, val: bool) -> &mut Self {
134 self.set_cancelable(val);
135 self
136 }
137 #[deprecated = "Use `set_composed()` instead."]
138 pub fn composed(&mut self, val: bool) -> &mut Self {
139 self.set_composed(val);
140 self
141 }
142 #[deprecated = "Use `set_detail()` instead."]
143 pub fn detail(&mut self, val: i32) -> &mut Self {
144 self.set_detail(val);
145 self
146 }
147 #[cfg(feature = "Window")]
148 #[deprecated = "Use `set_view()` instead."]
149 pub fn view(&mut self, val: Option<&Window>) -> &mut Self {
150 self.set_view(val);
151 self
152 }
153 #[deprecated = "Use `set_data()` instead."]
154 pub fn data(&mut self, val: Option<&str>) -> &mut Self {
155 self.set_data(val);
156 self
157 }
158 #[cfg(feature = "DataTransfer")]
159 #[deprecated = "Use `set_data_transfer()` instead."]
160 pub fn data_transfer(&mut self, val: Option<&DataTransfer>) -> &mut Self {
161 self.set_data_transfer(val);
162 self
163 }
164 #[deprecated = "Use `set_input_type()` instead."]
165 pub fn input_type(&mut self, val: &str) -> &mut Self {
166 self.set_input_type(val);
167 self
168 }
169 #[deprecated = "Use `set_is_composing()` instead."]
170 pub fn is_composing(&mut self, val: bool) -> &mut Self {
171 self.set_is_composing(val);
172 self
173 }
174 #[deprecated = "Use `set_target_ranges()` instead."]
175 pub fn target_ranges(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
176 self.set_target_ranges(val);
177 self
178 }
179}
180impl Default for InputEventInit {
181 fn default() -> Self {
182 Self::new()
183 }
184}