web_sys/features/
gen_ServiceWorkerRegistration.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 = ServiceWorkerRegistration , typescript_type = "ServiceWorkerRegistration")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ServiceWorkerRegistration` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
14    pub type ServiceWorkerRegistration;
15    #[cfg(feature = "ServiceWorker")]
16    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerRegistration" , js_name = installing)]
17    #[doc = "Getter for the `installing` field of this object."]
18    #[doc = ""]
19    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/installing)"]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `ServiceWorker`, `ServiceWorkerRegistration`*"]
22    pub fn installing(this: &ServiceWorkerRegistration) -> Option<ServiceWorker>;
23    #[cfg(feature = "ServiceWorker")]
24    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerRegistration" , js_name = waiting)]
25    #[doc = "Getter for the `waiting` field of this object."]
26    #[doc = ""]
27    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/waiting)"]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `ServiceWorker`, `ServiceWorkerRegistration`*"]
30    pub fn waiting(this: &ServiceWorkerRegistration) -> Option<ServiceWorker>;
31    #[cfg(feature = "ServiceWorker")]
32    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerRegistration" , js_name = active)]
33    #[doc = "Getter for the `active` field of this object."]
34    #[doc = ""]
35    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/active)"]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `ServiceWorker`, `ServiceWorkerRegistration`*"]
38    pub fn active(this: &ServiceWorkerRegistration) -> Option<ServiceWorker>;
39    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerRegistration" , js_name = scope)]
40    #[doc = "Getter for the `scope` field of this object."]
41    #[doc = ""]
42    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/scope)"]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
45    pub fn scope(this: &ServiceWorkerRegistration) -> ::alloc::string::String;
46    #[cfg(feature = "ServiceWorkerUpdateViaCache")]
47    # [wasm_bindgen (structural , catch , method , getter , js_class = "ServiceWorkerRegistration" , js_name = updateViaCache)]
48    #[doc = "Getter for the `updateViaCache` field of this object."]
49    #[doc = ""]
50    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/updateViaCache)"]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`, `ServiceWorkerUpdateViaCache`*"]
53    pub fn update_via_cache(
54        this: &ServiceWorkerRegistration,
55    ) -> Result<ServiceWorkerUpdateViaCache, JsValue>;
56    # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerRegistration" , js_name = onupdatefound)]
57    #[doc = "Getter for the `onupdatefound` field of this object."]
58    #[doc = ""]
59    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/onupdatefound)"]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
62    pub fn onupdatefound(this: &ServiceWorkerRegistration) -> Option<::js_sys::Function>;
63    # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerRegistration" , js_name = onupdatefound)]
64    #[doc = "Setter for the `onupdatefound` field of this object."]
65    #[doc = ""]
66    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/onupdatefound)"]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
69    pub fn set_onupdatefound(this: &ServiceWorkerRegistration, value: Option<&::js_sys::Function>);
70    #[cfg(feature = "PushManager")]
71    # [wasm_bindgen (structural , catch , method , getter , js_class = "ServiceWorkerRegistration" , js_name = pushManager)]
72    #[doc = "Getter for the `pushManager` field of this object."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/pushManager)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `PushManager`, `ServiceWorkerRegistration`*"]
77    pub fn push_manager(this: &ServiceWorkerRegistration) -> Result<PushManager, JsValue>;
78    # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = getNotifications)]
79    #[doc = "The `getNotifications()` method."]
80    #[doc = ""]
81    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/getNotifications)"]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
84    pub fn get_notifications(
85        this: &ServiceWorkerRegistration,
86    ) -> Result<::js_sys::Promise, JsValue>;
87    # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = showNotification)]
88    #[doc = "The `showNotification()` method."]
89    #[doc = ""]
90    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification)"]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
93    pub fn show_notification(
94        this: &ServiceWorkerRegistration,
95        title: &str,
96    ) -> Result<::js_sys::Promise, JsValue>;
97    #[cfg(feature = "NotificationOptions")]
98    # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = showNotification)]
99    #[doc = "The `showNotification()` method."]
100    #[doc = ""]
101    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification)"]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`, `ServiceWorkerRegistration`*"]
104    pub fn show_notification_with_options(
105        this: &ServiceWorkerRegistration,
106        title: &str,
107        options: &NotificationOptions,
108    ) -> Result<::js_sys::Promise, JsValue>;
109    # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = unregister)]
110    #[doc = "The `unregister()` method."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/unregister)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
115    pub fn unregister(this: &ServiceWorkerRegistration) -> Result<::js_sys::Promise, JsValue>;
116    # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = update)]
117    #[doc = "The `update()` method."]
118    #[doc = ""]
119    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/update)"]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"]
122    pub fn update(this: &ServiceWorkerRegistration) -> Result<::js_sys::Promise, JsValue>;
123}