Skip to main content

web_sys/features/
gen_CustomEvent.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 = "Event",
9        extends = "::js_sys::Object",
10        js_name = "CustomEvent",
11        typescript_type = "CustomEvent"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `CustomEvent` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
19    pub type CustomEvent;
20    #[wasm_bindgen(method, getter, js_class = "CustomEvent", js_name = "detail")]
21    #[doc = "Getter for the `detail` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
26    pub fn detail(this: &CustomEvent) -> ::wasm_bindgen::JsValue;
27    #[wasm_bindgen(catch, constructor, js_class = "CustomEvent")]
28    #[doc = "The `new CustomEvent(..)` constructor, creating a new instance of `CustomEvent`."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
33    pub fn new(type_: &str) -> Result<CustomEvent, JsValue>;
34    #[cfg(feature = "CustomEventInit")]
35    #[wasm_bindgen(catch, constructor, js_class = "CustomEvent")]
36    #[doc = "The `new CustomEvent(..)` constructor, creating a new instance of `CustomEvent`."]
37    #[doc = ""]
38    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)"]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`, `CustomEventInit`*"]
41    pub fn new_with_event_init_dict(
42        type_: &str,
43        event_init_dict: &CustomEventInit,
44    ) -> Result<CustomEvent, JsValue>;
45    #[wasm_bindgen(method, js_class = "CustomEvent", js_name = "initCustomEvent")]
46    #[doc = "The `initCustomEvent()` method."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
51    pub fn init_custom_event(this: &CustomEvent, type_: &str);
52    #[wasm_bindgen(method, js_class = "CustomEvent", js_name = "initCustomEvent")]
53    #[doc = "The `initCustomEvent()` method."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
58    pub fn init_custom_event_with_can_bubble(this: &CustomEvent, type_: &str, can_bubble: bool);
59    #[wasm_bindgen(method, js_class = "CustomEvent", js_name = "initCustomEvent")]
60    #[doc = "The `initCustomEvent()` method."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
65    pub fn init_custom_event_with_can_bubble_and_cancelable(
66        this: &CustomEvent,
67        type_: &str,
68        can_bubble: bool,
69        cancelable: bool,
70    );
71    #[wasm_bindgen(method, js_class = "CustomEvent", js_name = "initCustomEvent")]
72    #[doc = "The `initCustomEvent()` method."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `CustomEvent`*"]
77    pub fn init_custom_event_with_can_bubble_and_cancelable_and_detail(
78        this: &CustomEvent,
79        type_: &str,
80        can_bubble: bool,
81        cancelable: bool,
82        detail: &::wasm_bindgen::JsValue,
83    );
84}