web_sys/features/
gen_BroadcastChannel.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = BroadcastChannel , typescript_type = "BroadcastChannel")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `BroadcastChannel` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
14 pub type BroadcastChannel;
15 # [wasm_bindgen (structural , method , getter , js_class = "BroadcastChannel" , js_name = name)]
16 #[doc = "Getter for the `name` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/name)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
21 pub fn name(this: &BroadcastChannel) -> ::alloc::string::String;
22 # [wasm_bindgen (structural , method , getter , js_class = "BroadcastChannel" , js_name = onmessage)]
23 #[doc = "Getter for the `onmessage` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/onmessage)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
28 pub fn onmessage(this: &BroadcastChannel) -> Option<::js_sys::Function>;
29 # [wasm_bindgen (structural , method , setter , js_class = "BroadcastChannel" , js_name = onmessage)]
30 #[doc = "Setter for the `onmessage` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/onmessage)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
35 pub fn set_onmessage(this: &BroadcastChannel, value: Option<&::js_sys::Function>);
36 # [wasm_bindgen (structural , method , getter , js_class = "BroadcastChannel" , js_name = onmessageerror)]
37 #[doc = "Getter for the `onmessageerror` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/onmessageerror)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
42 pub fn onmessageerror(this: &BroadcastChannel) -> Option<::js_sys::Function>;
43 # [wasm_bindgen (structural , method , setter , js_class = "BroadcastChannel" , js_name = onmessageerror)]
44 #[doc = "Setter for the `onmessageerror` field of this object."]
45 #[doc = ""]
46 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/onmessageerror)"]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
49 pub fn set_onmessageerror(this: &BroadcastChannel, value: Option<&::js_sys::Function>);
50 #[wasm_bindgen(catch, constructor, js_class = "BroadcastChannel")]
51 #[doc = "The `new BroadcastChannel(..)` constructor, creating a new instance of `BroadcastChannel`."]
52 #[doc = ""]
53 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/BroadcastChannel)"]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
56 pub fn new(channel: &str) -> Result<BroadcastChannel, JsValue>;
57 # [wasm_bindgen (method , structural , js_class = "BroadcastChannel" , js_name = close)]
58 #[doc = "The `close()` method."]
59 #[doc = ""]
60 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/close)"]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
63 pub fn close(this: &BroadcastChannel);
64 # [wasm_bindgen (catch , method , structural , js_class = "BroadcastChannel" , js_name = postMessage)]
65 #[doc = "The `postMessage()` method."]
66 #[doc = ""]
67 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/postMessage)"]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
70 pub fn post_message(
71 this: &BroadcastChannel,
72 message: &::wasm_bindgen::JsValue,
73 ) -> Result<(), JsValue>;
74}