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