Skip to main content

web_sys/features/
gen_TouchEvent.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "UiEvent",
9        extends = "Event",
10        extends = "::js_sys::Object",
11        js_name = "TouchEvent",
12        typescript_type = "TouchEvent"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `TouchEvent` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
20    pub type TouchEvent;
21    #[cfg(feature = "TouchList")]
22    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "touches")]
23    #[doc = "Getter for the `touches` field of this object."]
24    #[doc = ""]
25    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches)"]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchList`*"]
28    pub fn touches(this: &TouchEvent) -> TouchList;
29    #[cfg(feature = "TouchList")]
30    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "targetTouches")]
31    #[doc = "Getter for the `targetTouches` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/targetTouches)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchList`*"]
36    pub fn target_touches(this: &TouchEvent) -> TouchList;
37    #[cfg(feature = "TouchList")]
38    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "changedTouches")]
39    #[doc = "Getter for the `changedTouches` field of this object."]
40    #[doc = ""]
41    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/changedTouches)"]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchList`*"]
44    pub fn changed_touches(this: &TouchEvent) -> TouchList;
45    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "altKey")]
46    #[doc = "Getter for the `altKey` field of this object."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/altKey)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
51    pub fn alt_key(this: &TouchEvent) -> bool;
52    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "metaKey")]
53    #[doc = "Getter for the `metaKey` field of this object."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/metaKey)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
58    pub fn meta_key(this: &TouchEvent) -> bool;
59    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "ctrlKey")]
60    #[doc = "Getter for the `ctrlKey` field of this object."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/ctrlKey)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
65    pub fn ctrl_key(this: &TouchEvent) -> bool;
66    #[wasm_bindgen(method, getter, js_class = "TouchEvent", js_name = "shiftKey")]
67    #[doc = "Getter for the `shiftKey` field of this object."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/shiftKey)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
72    pub fn shift_key(this: &TouchEvent) -> bool;
73    #[wasm_bindgen(catch, constructor, js_class = "TouchEvent")]
74    #[doc = "The `new TouchEvent(..)` constructor, creating a new instance of `TouchEvent`."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
79    pub fn new(type_: &str) -> Result<TouchEvent, JsValue>;
80    #[cfg(feature = "TouchEventInit")]
81    #[wasm_bindgen(catch, constructor, js_class = "TouchEvent")]
82    #[doc = "The `new TouchEvent(..)` constructor, creating a new instance of `TouchEvent`."]
83    #[doc = ""]
84    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)"]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchEventInit`*"]
87    pub fn new_with_event_init_dict(
88        type_: &str,
89        event_init_dict: &TouchEventInit,
90    ) -> Result<TouchEvent, JsValue>;
91    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
92    #[doc = "The `initTouchEvent()` method."]
93    #[doc = ""]
94    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
95    #[doc = ""]
96    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
97    pub fn init_touch_event(this: &TouchEvent, type_: &str);
98    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
99    #[doc = "The `initTouchEvent()` method."]
100    #[doc = ""]
101    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
104    pub fn init_touch_event_with_can_bubble(this: &TouchEvent, type_: &str, can_bubble: bool);
105    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
106    #[doc = "The `initTouchEvent()` method."]
107    #[doc = ""]
108    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`*"]
111    pub fn init_touch_event_with_can_bubble_and_cancelable(
112        this: &TouchEvent,
113        type_: &str,
114        can_bubble: bool,
115        cancelable: bool,
116    );
117    #[cfg(feature = "Window")]
118    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
119    #[doc = "The `initTouchEvent()` method."]
120    #[doc = ""]
121    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
122    #[doc = ""]
123    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `Window`*"]
124    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view(
125        this: &TouchEvent,
126        type_: &str,
127        can_bubble: bool,
128        cancelable: bool,
129        view: Option<&Window>,
130    );
131    #[cfg(feature = "Window")]
132    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
133    #[doc = "The `initTouchEvent()` method."]
134    #[doc = ""]
135    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
136    #[doc = ""]
137    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `Window`*"]
138    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail(
139        this: &TouchEvent,
140        type_: &str,
141        can_bubble: bool,
142        cancelable: bool,
143        view: Option<&Window>,
144        detail: i32,
145    );
146    #[cfg(feature = "Window")]
147    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
148    #[doc = "The `initTouchEvent()` method."]
149    #[doc = ""]
150    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
151    #[doc = ""]
152    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `Window`*"]
153    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key(
154        this: &TouchEvent,
155        type_: &str,
156        can_bubble: bool,
157        cancelable: bool,
158        view: Option<&Window>,
159        detail: i32,
160        ctrl_key: bool,
161    );
162    #[cfg(feature = "Window")]
163    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
164    #[doc = "The `initTouchEvent()` method."]
165    #[doc = ""]
166    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
167    #[doc = ""]
168    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `Window`*"]
169    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key_and_alt_key(
170        this: &TouchEvent,
171        type_: &str,
172        can_bubble: bool,
173        cancelable: bool,
174        view: Option<&Window>,
175        detail: i32,
176        ctrl_key: bool,
177        alt_key: bool,
178    );
179    #[cfg(feature = "Window")]
180    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
181    #[doc = "The `initTouchEvent()` method."]
182    #[doc = ""]
183    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
184    #[doc = ""]
185    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `Window`*"]
186    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key_and_alt_key_and_shift_key(
187        this: &TouchEvent,
188        type_: &str,
189        can_bubble: bool,
190        cancelable: bool,
191        view: Option<&Window>,
192        detail: i32,
193        ctrl_key: bool,
194        alt_key: bool,
195        shift_key: bool,
196    );
197    #[cfg(feature = "Window")]
198    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
199    #[doc = "The `initTouchEvent()` method."]
200    #[doc = ""]
201    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
202    #[doc = ""]
203    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `Window`*"]
204    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key_and_alt_key_and_shift_key_and_meta_key(
205        this: &TouchEvent,
206        type_: &str,
207        can_bubble: bool,
208        cancelable: bool,
209        view: Option<&Window>,
210        detail: i32,
211        ctrl_key: bool,
212        alt_key: bool,
213        shift_key: bool,
214        meta_key: bool,
215    );
216    #[cfg(all(feature = "TouchList", feature = "Window",))]
217    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
218    #[doc = "The `initTouchEvent()` method."]
219    #[doc = ""]
220    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
221    #[doc = ""]
222    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchList`, `Window`*"]
223    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key_and_alt_key_and_shift_key_and_meta_key_and_touches(
224        this: &TouchEvent,
225        type_: &str,
226        can_bubble: bool,
227        cancelable: bool,
228        view: Option<&Window>,
229        detail: i32,
230        ctrl_key: bool,
231        alt_key: bool,
232        shift_key: bool,
233        meta_key: bool,
234        touches: Option<&TouchList>,
235    );
236    #[cfg(all(feature = "TouchList", feature = "Window",))]
237    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
238    #[doc = "The `initTouchEvent()` method."]
239    #[doc = ""]
240    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
241    #[doc = ""]
242    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchList`, `Window`*"]
243    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key_and_alt_key_and_shift_key_and_meta_key_and_touches_and_target_touches(
244        this: &TouchEvent,
245        type_: &str,
246        can_bubble: bool,
247        cancelable: bool,
248        view: Option<&Window>,
249        detail: i32,
250        ctrl_key: bool,
251        alt_key: bool,
252        shift_key: bool,
253        meta_key: bool,
254        touches: Option<&TouchList>,
255        target_touches: Option<&TouchList>,
256    );
257    #[cfg(all(feature = "TouchList", feature = "Window",))]
258    #[wasm_bindgen(method, js_class = "TouchEvent", js_name = "initTouchEvent")]
259    #[doc = "The `initTouchEvent()` method."]
260    #[doc = ""]
261    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent)"]
262    #[doc = ""]
263    #[doc = "*This API requires the following crate features to be activated: `TouchEvent`, `TouchList`, `Window`*"]
264    pub fn init_touch_event_with_can_bubble_and_cancelable_and_view_and_detail_and_ctrl_key_and_alt_key_and_shift_key_and_meta_key_and_touches_and_target_touches_and_changed_touches(
265        this: &TouchEvent,
266        type_: &str,
267        can_bubble: bool,
268        cancelable: bool,
269        view: Option<&Window>,
270        detail: i32,
271        ctrl_key: bool,
272        alt_key: bool,
273        shift_key: bool,
274        meta_key: bool,
275        touches: Option<&TouchList>,
276        target_touches: Option<&TouchList>,
277        changed_touches: Option<&TouchList>,
278    );
279}