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