maxcountryman_web_sys/features/
gen_SharedWorker.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = SharedWorker , typescript_type = "SharedWorker")]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `SharedWorker` class."]
9    #[doc = ""]
10    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker)"]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `SharedWorker`*"]
13    pub type SharedWorker;
14    #[cfg(feature = "MessagePort")]
15    # [wasm_bindgen (structural , method , getter , js_class = "SharedWorker" , js_name = port)]
16    #[doc = "Getter for the `port` field of this object."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/port)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `MessagePort`, `SharedWorker`*"]
21    pub fn port(this: &SharedWorker) -> MessagePort;
22    # [wasm_bindgen (structural , method , getter , js_class = "SharedWorker" , js_name = onerror)]
23    #[doc = "Getter for the `onerror` field of this object."]
24    #[doc = ""]
25    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/onerror)"]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `SharedWorker`*"]
28    pub fn onerror(this: &SharedWorker) -> Option<::js_sys::Function>;
29    # [wasm_bindgen (structural , method , setter , js_class = "SharedWorker" , js_name = onerror)]
30    #[doc = "Setter for the `onerror` field of this object."]
31    #[doc = ""]
32    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/onerror)"]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `SharedWorker`*"]
35    pub fn set_onerror(this: &SharedWorker, value: Option<&::js_sys::Function>);
36    #[wasm_bindgen(catch, constructor, js_class = "SharedWorker")]
37    #[doc = "The `new SharedWorker(..)` constructor, creating a new instance of `SharedWorker`."]
38    #[doc = ""]
39    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/SharedWorker)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `SharedWorker`*"]
42    pub fn new(script_url: &str) -> Result<SharedWorker, JsValue>;
43    #[wasm_bindgen(catch, constructor, js_class = "SharedWorker")]
44    #[doc = "The `new SharedWorker(..)` constructor, creating a new instance of `SharedWorker`."]
45    #[doc = ""]
46    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/SharedWorker)"]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `SharedWorker`*"]
49    pub fn new_with_str(script_url: &str, options: &str) -> Result<SharedWorker, JsValue>;
50    #[cfg(feature = "WorkerOptions")]
51    #[wasm_bindgen(catch, constructor, js_class = "SharedWorker")]
52    #[doc = "The `new SharedWorker(..)` constructor, creating a new instance of `SharedWorker`."]
53    #[doc = ""]
54    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/SharedWorker)"]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `SharedWorker`, `WorkerOptions`*"]
57    pub fn new_with_worker_options(
58        script_url: &str,
59        options: &WorkerOptions,
60    ) -> Result<SharedWorker, JsValue>;
61}