maxcountryman_web_sys/features/
gen_Event.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Event , typescript_type = "Event")]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `Event` class."]
9    #[doc = ""]
10    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event)"]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
13    pub type Event;
14    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = type)]
15    #[doc = "Getter for the `type` field of this object."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/type)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
20    pub fn type_(this: &Event) -> String;
21    #[cfg(feature = "EventTarget")]
22    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = target)]
23    #[doc = "Getter for the `target` field of this object."]
24    #[doc = ""]
25    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/target)"]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `Event`, `EventTarget`*"]
28    pub fn target(this: &Event) -> Option<EventTarget>;
29    #[cfg(feature = "EventTarget")]
30    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = currentTarget)]
31    #[doc = "Getter for the `currentTarget` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `Event`, `EventTarget`*"]
36    pub fn current_target(this: &Event) -> Option<EventTarget>;
37    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = eventPhase)]
38    #[doc = "Getter for the `eventPhase` field of this object."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
43    pub fn event_phase(this: &Event) -> u16;
44    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = bubbles)]
45    #[doc = "Getter for the `bubbles` field of this object."]
46    #[doc = ""]
47    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/bubbles)"]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
50    pub fn bubbles(this: &Event) -> bool;
51    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = cancelable)]
52    #[doc = "Getter for the `cancelable` field of this object."]
53    #[doc = ""]
54    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable)"]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
57    pub fn cancelable(this: &Event) -> bool;
58    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = defaultPrevented)]
59    #[doc = "Getter for the `defaultPrevented` field of this object."]
60    #[doc = ""]
61    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/defaultPrevented)"]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
64    pub fn default_prevented(this: &Event) -> bool;
65    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = composed)]
66    #[doc = "Getter for the `composed` field of this object."]
67    #[doc = ""]
68    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/composed)"]
69    #[doc = ""]
70    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
71    pub fn composed(this: &Event) -> bool;
72    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = isTrusted)]
73    #[doc = "Getter for the `isTrusted` field of this object."]
74    #[doc = ""]
75    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted)"]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
78    pub fn is_trusted(this: &Event) -> bool;
79    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = timeStamp)]
80    #[doc = "Getter for the `timeStamp` field of this object."]
81    #[doc = ""]
82    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp)"]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
85    pub fn time_stamp(this: &Event) -> f64;
86    # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = cancelBubble)]
87    #[doc = "Getter for the `cancelBubble` field of this object."]
88    #[doc = ""]
89    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble)"]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
92    pub fn cancel_bubble(this: &Event) -> bool;
93    # [wasm_bindgen (structural , method , setter , js_class = "Event" , js_name = cancelBubble)]
94    #[doc = "Setter for the `cancelBubble` field of this object."]
95    #[doc = ""]
96    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble)"]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
99    pub fn set_cancel_bubble(this: &Event, value: bool);
100    #[wasm_bindgen(catch, constructor, js_class = "Event")]
101    #[doc = "The `new Event(..)` constructor, creating a new instance of `Event`."]
102    #[doc = ""]
103    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)"]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
106    pub fn new(type_: &str) -> Result<Event, JsValue>;
107    #[cfg(feature = "EventInit")]
108    #[wasm_bindgen(catch, constructor, js_class = "Event")]
109    #[doc = "The `new Event(..)` constructor, creating a new instance of `Event`."]
110    #[doc = ""]
111    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)"]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `Event`, `EventInit`*"]
114    pub fn new_with_event_init_dict(
115        type_: &str,
116        event_init_dict: &EventInit,
117    ) -> Result<Event, JsValue>;
118    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = composedPath)]
119    #[doc = "The `composedPath()` method."]
120    #[doc = ""]
121    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath)"]
122    #[doc = ""]
123    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
124    pub fn composed_path(this: &Event) -> ::js_sys::Array;
125    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = initEvent)]
126    #[doc = "The `initEvent()` method."]
127    #[doc = ""]
128    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/initEvent)"]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
131    pub fn init_event(this: &Event, type_: &str);
132    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = initEvent)]
133    #[doc = "The `initEvent()` method."]
134    #[doc = ""]
135    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/initEvent)"]
136    #[doc = ""]
137    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
138    pub fn init_event_with_bubbles(this: &Event, type_: &str, bubbles: bool);
139    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = initEvent)]
140    #[doc = "The `initEvent()` method."]
141    #[doc = ""]
142    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/initEvent)"]
143    #[doc = ""]
144    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
145    pub fn init_event_with_bubbles_and_cancelable(
146        this: &Event,
147        type_: &str,
148        bubbles: bool,
149        cancelable: bool,
150    );
151    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = preventDefault)]
152    #[doc = "The `preventDefault()` method."]
153    #[doc = ""]
154    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)"]
155    #[doc = ""]
156    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
157    pub fn prevent_default(this: &Event);
158    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = stopImmediatePropagation)]
159    #[doc = "The `stopImmediatePropagation()` method."]
160    #[doc = ""]
161    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation)"]
162    #[doc = ""]
163    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
164    pub fn stop_immediate_propagation(this: &Event);
165    # [wasm_bindgen (method , structural , js_class = "Event" , js_name = stopPropagation)]
166    #[doc = "The `stopPropagation()` method."]
167    #[doc = ""]
168    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation)"]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
171    pub fn stop_propagation(this: &Event);
172}
173impl Event {
174    #[doc = "The `Event.NONE` const."]
175    #[doc = ""]
176    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
177    pub const NONE: u16 = 0i64 as u16;
178    #[doc = "The `Event.CAPTURING_PHASE` const."]
179    #[doc = ""]
180    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
181    pub const CAPTURING_PHASE: u16 = 1u64 as u16;
182    #[doc = "The `Event.AT_TARGET` const."]
183    #[doc = ""]
184    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
185    pub const AT_TARGET: u16 = 2u64 as u16;
186    #[doc = "The `Event.BUBBLING_PHASE` const."]
187    #[doc = ""]
188    #[doc = "*This API requires the following crate features to be activated: `Event`*"]
189    pub const BUBBLING_PHASE: u16 = 3u64 as u16;
190}