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