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