web_sys/features/
gen_RegistrationOptions.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RegistrationOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RegistrationOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"]
12    pub type RegistrationOptions;
13    #[doc = "Get the `scope` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"]
16    #[wasm_bindgen(method, getter = "scope")]
17    pub fn get_scope(this: &RegistrationOptions) -> Option<::alloc::string::String>;
18    #[doc = "Change the `scope` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"]
21    #[wasm_bindgen(method, setter = "scope")]
22    pub fn set_scope(this: &RegistrationOptions, val: &str);
23    #[doc = "Get the `type` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"]
26    #[wasm_bindgen(method, getter = "type")]
27    pub fn get_type(this: &RegistrationOptions) -> Option<::alloc::string::String>;
28    #[doc = "Change the `type` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"]
31    #[wasm_bindgen(method, setter = "type")]
32    pub fn set_type(this: &RegistrationOptions, val: &str);
33    #[cfg(feature = "ServiceWorkerUpdateViaCache")]
34    #[doc = "Get the `updateViaCache` field of this object."]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerUpdateViaCache`*"]
37    #[wasm_bindgen(method, getter = "updateViaCache")]
38    pub fn get_update_via_cache(this: &RegistrationOptions) -> Option<ServiceWorkerUpdateViaCache>;
39    #[cfg(feature = "ServiceWorkerUpdateViaCache")]
40    #[doc = "Change the `updateViaCache` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerUpdateViaCache`*"]
43    #[wasm_bindgen(method, setter = "updateViaCache")]
44    pub fn set_update_via_cache(this: &RegistrationOptions, val: ServiceWorkerUpdateViaCache);
45}
46impl RegistrationOptions {
47    #[doc = "Construct a new `RegistrationOptions`."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"]
50    pub fn new() -> Self {
51        #[allow(unused_mut)]
52        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
53        ret
54    }
55    #[deprecated = "Use `set_scope()` instead."]
56    pub fn scope(&mut self, val: &str) -> &mut Self {
57        self.set_scope(val);
58        self
59    }
60    #[deprecated = "Use `set_type()` instead."]
61    pub fn type_(&mut self, val: &str) -> &mut Self {
62        self.set_type(val);
63        self
64    }
65    #[cfg(feature = "ServiceWorkerUpdateViaCache")]
66    #[deprecated = "Use `set_update_via_cache()` instead."]
67    pub fn update_via_cache(&mut self, val: ServiceWorkerUpdateViaCache) -> &mut Self {
68        self.set_update_via_cache(val);
69        self
70    }
71}
72impl Default for RegistrationOptions {
73    fn default() -> Self {
74        Self::new()
75    }
76}