web_sys/features/
gen_CloseEvent.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = CloseEvent , typescript_type = "CloseEvent")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `CloseEvent` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
14 pub type CloseEvent;
15 # [wasm_bindgen (structural , method , getter , js_class = "CloseEvent" , js_name = wasClean)]
16 #[doc = "Getter for the `wasClean` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/wasClean)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
21 pub fn was_clean(this: &CloseEvent) -> bool;
22 # [wasm_bindgen (structural , method , getter , js_class = "CloseEvent" , js_name = code)]
23 #[doc = "Getter for the `code` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
28 pub fn code(this: &CloseEvent) -> u16;
29 # [wasm_bindgen (structural , method , getter , js_class = "CloseEvent" , js_name = reason)]
30 #[doc = "Getter for the `reason` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/reason)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
35 pub fn reason(this: &CloseEvent) -> ::alloc::string::String;
36 #[wasm_bindgen(catch, constructor, js_class = "CloseEvent")]
37 #[doc = "The `new CloseEvent(..)` constructor, creating a new instance of `CloseEvent`."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/CloseEvent)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
42 pub fn new(type_: &str) -> Result<CloseEvent, JsValue>;
43 #[cfg(feature = "CloseEventInit")]
44 #[wasm_bindgen(catch, constructor, js_class = "CloseEvent")]
45 #[doc = "The `new CloseEvent(..)` constructor, creating a new instance of `CloseEvent`."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/CloseEvent)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `CloseEvent`, `CloseEventInit`*"]
50 pub fn new_with_event_init_dict(
51 type_: &str,
52 event_init_dict: &CloseEventInit,
53 ) -> Result<CloseEvent, JsValue>;
54}