Skip to main content

web_sys/features/
gen_ServiceWorkerGlobalScope.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "WorkerGlobalScope",
9        extends = "EventTarget",
10        extends = "::js_sys::Object",
11        js_name = "ServiceWorkerGlobalScope",
12        typescript_type = "ServiceWorkerGlobalScope"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `ServiceWorkerGlobalScope` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
20    pub type ServiceWorkerGlobalScope;
21    #[cfg(feature = "CookieStore")]
22    #[wasm_bindgen(
23        method,
24        getter,
25        js_class = "ServiceWorkerGlobalScope",
26        js_name = "cookieStore"
27    )]
28    #[doc = "Getter for the `cookieStore` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/cookieStore)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `CookieStore`, `ServiceWorkerGlobalScope`*"]
33    pub fn cookie_store(this: &ServiceWorkerGlobalScope) -> CookieStore;
34    #[wasm_bindgen(
35        method,
36        getter,
37        js_class = "ServiceWorkerGlobalScope",
38        js_name = "oncookiechange"
39    )]
40    #[doc = "Getter for the `oncookiechange` field of this object."]
41    #[doc = ""]
42    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/oncookiechange)"]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
45    pub fn oncookiechange(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
46    #[wasm_bindgen(
47        method,
48        setter,
49        js_class = "ServiceWorkerGlobalScope",
50        js_name = "oncookiechange"
51    )]
52    #[doc = "Setter for the `oncookiechange` field of this object."]
53    #[doc = ""]
54    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/oncookiechange)"]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
57    pub fn set_oncookiechange(this: &ServiceWorkerGlobalScope, value: Option<&::js_sys::Function>);
58    #[cfg(feature = "Clients")]
59    #[wasm_bindgen(
60        method,
61        getter,
62        js_class = "ServiceWorkerGlobalScope",
63        js_name = "clients"
64    )]
65    #[doc = "Getter for the `clients` field of this object."]
66    #[doc = ""]
67    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/clients)"]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `Clients`, `ServiceWorkerGlobalScope`*"]
70    pub fn clients(this: &ServiceWorkerGlobalScope) -> Clients;
71    #[cfg(feature = "ServiceWorkerRegistration")]
72    #[wasm_bindgen(
73        method,
74        getter,
75        js_class = "ServiceWorkerGlobalScope",
76        js_name = "registration"
77    )]
78    #[doc = "Getter for the `registration` field of this object."]
79    #[doc = ""]
80    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/registration)"]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`, `ServiceWorkerRegistration`*"]
83    pub fn registration(this: &ServiceWorkerGlobalScope) -> ServiceWorkerRegistration;
84    #[wasm_bindgen(
85        method,
86        getter,
87        js_class = "ServiceWorkerGlobalScope",
88        js_name = "oninstall"
89    )]
90    #[doc = "Getter for the `oninstall` field of this object."]
91    #[doc = ""]
92    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/oninstall)"]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
95    pub fn oninstall(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
96    #[wasm_bindgen(
97        method,
98        setter,
99        js_class = "ServiceWorkerGlobalScope",
100        js_name = "oninstall"
101    )]
102    #[doc = "Setter for the `oninstall` field of this object."]
103    #[doc = ""]
104    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/oninstall)"]
105    #[doc = ""]
106    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
107    pub fn set_oninstall(this: &ServiceWorkerGlobalScope, value: Option<&::js_sys::Function>);
108    #[wasm_bindgen(
109        method,
110        getter,
111        js_class = "ServiceWorkerGlobalScope",
112        js_name = "onactivate"
113    )]
114    #[doc = "Getter for the `onactivate` field of this object."]
115    #[doc = ""]
116    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onactivate)"]
117    #[doc = ""]
118    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
119    pub fn onactivate(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
120    #[wasm_bindgen(
121        method,
122        setter,
123        js_class = "ServiceWorkerGlobalScope",
124        js_name = "onactivate"
125    )]
126    #[doc = "Setter for the `onactivate` field of this object."]
127    #[doc = ""]
128    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onactivate)"]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
131    pub fn set_onactivate(this: &ServiceWorkerGlobalScope, value: Option<&::js_sys::Function>);
132    #[wasm_bindgen(
133        method,
134        getter,
135        js_class = "ServiceWorkerGlobalScope",
136        js_name = "onfetch"
137    )]
138    #[doc = "Getter for the `onfetch` field of this object."]
139    #[doc = ""]
140    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onfetch)"]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
143    pub fn onfetch(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
144    #[wasm_bindgen(
145        method,
146        setter,
147        js_class = "ServiceWorkerGlobalScope",
148        js_name = "onfetch"
149    )]
150    #[doc = "Setter for the `onfetch` field of this object."]
151    #[doc = ""]
152    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onfetch)"]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
155    pub fn set_onfetch(this: &ServiceWorkerGlobalScope, value: Option<&::js_sys::Function>);
156    #[wasm_bindgen(
157        method,
158        getter,
159        js_class = "ServiceWorkerGlobalScope",
160        js_name = "onmessage"
161    )]
162    #[doc = "Getter for the `onmessage` field of this object."]
163    #[doc = ""]
164    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onmessage)"]
165    #[doc = ""]
166    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
167    pub fn onmessage(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
168    #[wasm_bindgen(
169        method,
170        setter,
171        js_class = "ServiceWorkerGlobalScope",
172        js_name = "onmessage"
173    )]
174    #[doc = "Setter for the `onmessage` field of this object."]
175    #[doc = ""]
176    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onmessage)"]
177    #[doc = ""]
178    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
179    pub fn set_onmessage(this: &ServiceWorkerGlobalScope, value: Option<&::js_sys::Function>);
180    #[wasm_bindgen(
181        method,
182        getter,
183        js_class = "ServiceWorkerGlobalScope",
184        js_name = "onpush"
185    )]
186    #[doc = "Getter for the `onpush` field of this object."]
187    #[doc = ""]
188    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onpush)"]
189    #[doc = ""]
190    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
191    pub fn onpush(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
192    #[wasm_bindgen(
193        method,
194        setter,
195        js_class = "ServiceWorkerGlobalScope",
196        js_name = "onpush"
197    )]
198    #[doc = "Setter for the `onpush` field of this object."]
199    #[doc = ""]
200    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onpush)"]
201    #[doc = ""]
202    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
203    pub fn set_onpush(this: &ServiceWorkerGlobalScope, value: Option<&::js_sys::Function>);
204    #[wasm_bindgen(
205        method,
206        getter,
207        js_class = "ServiceWorkerGlobalScope",
208        js_name = "onpushsubscriptionchange"
209    )]
210    #[doc = "Getter for the `onpushsubscriptionchange` field of this object."]
211    #[doc = ""]
212    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onpushsubscriptionchange)"]
213    #[doc = ""]
214    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
215    pub fn onpushsubscriptionchange(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
216    #[wasm_bindgen(
217        method,
218        setter,
219        js_class = "ServiceWorkerGlobalScope",
220        js_name = "onpushsubscriptionchange"
221    )]
222    #[doc = "Setter for the `onpushsubscriptionchange` field of this object."]
223    #[doc = ""]
224    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onpushsubscriptionchange)"]
225    #[doc = ""]
226    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
227    pub fn set_onpushsubscriptionchange(
228        this: &ServiceWorkerGlobalScope,
229        value: Option<&::js_sys::Function>,
230    );
231    #[wasm_bindgen(
232        method,
233        getter,
234        js_class = "ServiceWorkerGlobalScope",
235        js_name = "onnotificationclick"
236    )]
237    #[doc = "Getter for the `onnotificationclick` field of this object."]
238    #[doc = ""]
239    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onnotificationclick)"]
240    #[doc = ""]
241    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
242    pub fn onnotificationclick(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
243    #[wasm_bindgen(
244        method,
245        setter,
246        js_class = "ServiceWorkerGlobalScope",
247        js_name = "onnotificationclick"
248    )]
249    #[doc = "Setter for the `onnotificationclick` field of this object."]
250    #[doc = ""]
251    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onnotificationclick)"]
252    #[doc = ""]
253    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
254    pub fn set_onnotificationclick(
255        this: &ServiceWorkerGlobalScope,
256        value: Option<&::js_sys::Function>,
257    );
258    #[wasm_bindgen(
259        method,
260        getter,
261        js_class = "ServiceWorkerGlobalScope",
262        js_name = "onnotificationclose"
263    )]
264    #[doc = "Getter for the `onnotificationclose` field of this object."]
265    #[doc = ""]
266    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onnotificationclose)"]
267    #[doc = ""]
268    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
269    pub fn onnotificationclose(this: &ServiceWorkerGlobalScope) -> Option<::js_sys::Function>;
270    #[wasm_bindgen(
271        method,
272        setter,
273        js_class = "ServiceWorkerGlobalScope",
274        js_name = "onnotificationclose"
275    )]
276    #[doc = "Setter for the `onnotificationclose` field of this object."]
277    #[doc = ""]
278    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onnotificationclose)"]
279    #[doc = ""]
280    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
281    pub fn set_onnotificationclose(
282        this: &ServiceWorkerGlobalScope,
283        value: Option<&::js_sys::Function>,
284    );
285    #[wasm_bindgen(
286        catch,
287        method,
288        js_class = "ServiceWorkerGlobalScope",
289        js_name = "skipWaiting"
290    )]
291    #[doc = "The `skipWaiting()` method."]
292    #[doc = ""]
293    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting)"]
294    #[doc = ""]
295    #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerGlobalScope`*"]
296    pub fn skip_waiting(this: &ServiceWorkerGlobalScope) -> Result<::js_sys::Promise, JsValue>;
297}