Skip to main content

web_sys/features/
gen_CloseEvent.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 = "CloseEvent",
11        typescript_type = "CloseEvent"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `CloseEvent` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
19    pub type CloseEvent;
20    #[wasm_bindgen(method, getter, js_class = "CloseEvent", js_name = "wasClean")]
21    #[doc = "Getter for the `wasClean` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/wasClean)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
26    pub fn was_clean(this: &CloseEvent) -> bool;
27    #[wasm_bindgen(method, getter, js_class = "CloseEvent", js_name = "code")]
28    #[doc = "Getter for the `code` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
33    pub fn code(this: &CloseEvent) -> u16;
34    #[wasm_bindgen(method, getter, js_class = "CloseEvent", js_name = "reason")]
35    #[doc = "Getter for the `reason` field of this object."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/reason)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
40    pub fn reason(this: &CloseEvent) -> ::alloc::string::String;
41    #[wasm_bindgen(catch, constructor, js_class = "CloseEvent")]
42    #[doc = "The `new CloseEvent(..)` constructor, creating a new instance of `CloseEvent`."]
43    #[doc = ""]
44    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/CloseEvent)"]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
47    pub fn new(type_: &str) -> Result<CloseEvent, JsValue>;
48    #[cfg(feature = "CloseEventInit")]
49    #[wasm_bindgen(catch, constructor, js_class = "CloseEvent")]
50    #[doc = "The `new CloseEvent(..)` constructor, creating a new instance of `CloseEvent`."]
51    #[doc = ""]
52    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/CloseEvent)"]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `CloseEvent`, `CloseEventInit`*"]
55    pub fn new_with_event_init_dict(
56        type_: &str,
57        event_init_dict: &CloseEventInit,
58    ) -> Result<CloseEvent, JsValue>;
59}