web_sys/features/
gen_MessagePort.rs

1#![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 = MessagePort , typescript_type = "MessagePort")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MessagePort` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
14    pub type MessagePort;
15    # [wasm_bindgen (structural , method , getter , js_class = "MessagePort" , js_name = onmessage)]
16    #[doc = "Getter for the `onmessage` field of this object."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
21    pub fn onmessage(this: &MessagePort) -> Option<::js_sys::Function>;
22    # [wasm_bindgen (structural , method , setter , js_class = "MessagePort" , js_name = onmessage)]
23    #[doc = "Setter for the `onmessage` field of this object."]
24    #[doc = ""]
25    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage)"]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
28    pub fn set_onmessage(this: &MessagePort, value: Option<&::js_sys::Function>);
29    # [wasm_bindgen (structural , method , getter , js_class = "MessagePort" , js_name = onmessageerror)]
30    #[doc = "Getter for the `onmessageerror` field of this object."]
31    #[doc = ""]
32    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessageerror)"]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
35    pub fn onmessageerror(this: &MessagePort) -> Option<::js_sys::Function>;
36    # [wasm_bindgen (structural , method , setter , js_class = "MessagePort" , js_name = onmessageerror)]
37    #[doc = "Setter for the `onmessageerror` field of this object."]
38    #[doc = ""]
39    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessageerror)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
42    pub fn set_onmessageerror(this: &MessagePort, value: Option<&::js_sys::Function>);
43    # [wasm_bindgen (method , structural , js_class = "MessagePort" , js_name = close)]
44    #[doc = "The `close()` method."]
45    #[doc = ""]
46    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/close)"]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
49    pub fn close(this: &MessagePort);
50    # [wasm_bindgen (catch , method , structural , js_class = "MessagePort" , js_name = postMessage)]
51    #[doc = "The `postMessage()` method."]
52    #[doc = ""]
53    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/postMessage)"]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
56    pub fn post_message(
57        this: &MessagePort,
58        message: &::wasm_bindgen::JsValue,
59    ) -> Result<(), JsValue>;
60    # [wasm_bindgen (catch , method , structural , js_class = "MessagePort" , js_name = postMessage)]
61    #[doc = "The `postMessage()` method."]
62    #[doc = ""]
63    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/postMessage)"]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
66    pub fn post_message_with_transferable(
67        this: &MessagePort,
68        message: &::wasm_bindgen::JsValue,
69        transferable: &::wasm_bindgen::JsValue,
70    ) -> Result<(), JsValue>;
71    # [wasm_bindgen (method , structural , js_class = "MessagePort" , js_name = start)]
72    #[doc = "The `start()` method."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/start)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `MessagePort`*"]
77    pub fn start(this: &MessagePort);
78}