web_sys/features/
gen_ServiceWorkerContainer.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 = ServiceWorkerContainer , typescript_type = "ServiceWorkerContainer")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ServiceWorkerContainer` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
14    pub type ServiceWorkerContainer;
15    #[cfg(feature = "ServiceWorker")]
16    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = controller)]
17    #[doc = "Getter for the `controller` field of this object."]
18    #[doc = ""]
19    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller)"]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `ServiceWorker`, `ServiceWorkerContainer`*"]
22    pub fn controller(this: &ServiceWorkerContainer) -> Option<ServiceWorker>;
23    # [wasm_bindgen (structural , catch , method , getter , js_class = "ServiceWorkerContainer" , js_name = ready)]
24    #[doc = "Getter for the `ready` field of this object."]
25    #[doc = ""]
26    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready)"]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
29    pub fn ready(this: &ServiceWorkerContainer) -> Result<::js_sys::Promise, JsValue>;
30    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = oncontrollerchange)]
31    #[doc = "Getter for the `oncontrollerchange` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
36    pub fn oncontrollerchange(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>;
37    # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerContainer" , js_name = oncontrollerchange)]
38    #[doc = "Setter for the `oncontrollerchange` field of this object."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
43    pub fn set_oncontrollerchange(
44        this: &ServiceWorkerContainer,
45        value: Option<&::js_sys::Function>,
46    );
47    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = onerror)]
48    #[doc = "Getter for the `onerror` field of this object."]
49    #[doc = ""]
50    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onerror)"]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
53    pub fn onerror(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>;
54    # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerContainer" , js_name = onerror)]
55    #[doc = "Setter for the `onerror` field of this object."]
56    #[doc = ""]
57    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onerror)"]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
60    pub fn set_onerror(this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>);
61    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = onmessage)]
62    #[doc = "Getter for the `onmessage` field of this object."]
63    #[doc = ""]
64    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onmessage)"]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
67    pub fn onmessage(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>;
68    # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerContainer" , js_name = onmessage)]
69    #[doc = "Setter for the `onmessage` field of this object."]
70    #[doc = ""]
71    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onmessage)"]
72    #[doc = ""]
73    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
74    pub fn set_onmessage(this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>);
75    # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = getRegistration)]
76    #[doc = "The `getRegistration()` method."]
77    #[doc = ""]
78    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getRegistration)"]
79    #[doc = ""]
80    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
81    pub fn get_registration(this: &ServiceWorkerContainer) -> ::js_sys::Promise;
82    # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = getRegistration)]
83    #[doc = "The `getRegistration()` method."]
84    #[doc = ""]
85    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getRegistration)"]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
88    pub fn get_registration_with_document_url(
89        this: &ServiceWorkerContainer,
90        document_url: &str,
91    ) -> ::js_sys::Promise;
92    # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = getRegistrations)]
93    #[doc = "The `getRegistrations()` method."]
94    #[doc = ""]
95    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getRegistrations)"]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
98    pub fn get_registrations(this: &ServiceWorkerContainer) -> ::js_sys::Promise;
99    # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerContainer" , js_name = getScopeForUrl)]
100    #[doc = "The `getScopeForUrl()` method."]
101    #[doc = ""]
102    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getScopeForUrl)"]
103    #[doc = ""]
104    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
105    pub fn get_scope_for_url(
106        this: &ServiceWorkerContainer,
107        url: &str,
108    ) -> Result<::alloc::string::String, JsValue>;
109    # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = register)]
110    #[doc = "The `register()` method."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"]
115    pub fn register(this: &ServiceWorkerContainer, script_url: &str) -> ::js_sys::Promise;
116    #[cfg(feature = "RegistrationOptions")]
117    # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = register)]
118    #[doc = "The `register()` method."]
119    #[doc = ""]
120    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register)"]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerContainer`*"]
123    pub fn register_with_options(
124        this: &ServiceWorkerContainer,
125        script_url: &str,
126        options: &RegistrationOptions,
127    ) -> ::js_sys::Promise;
128}