web_sys/features/
gen_WorkletOptions.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 = WorkletOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `WorkletOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `WorkletOptions`*"]
12    pub type WorkletOptions;
13    #[cfg(feature = "RequestCredentials")]
14    #[doc = "Get the `credentials` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkletOptions`*"]
17    #[wasm_bindgen(method, getter = "credentials")]
18    pub fn get_credentials(this: &WorkletOptions) -> Option<RequestCredentials>;
19    #[cfg(feature = "RequestCredentials")]
20    #[doc = "Change the `credentials` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkletOptions`*"]
23    #[wasm_bindgen(method, setter = "credentials")]
24    pub fn set_credentials(this: &WorkletOptions, val: RequestCredentials);
25}
26impl WorkletOptions {
27    #[doc = "Construct a new `WorkletOptions`."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `WorkletOptions`*"]
30    pub fn new() -> Self {
31        #[allow(unused_mut)]
32        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
33        ret
34    }
35    #[cfg(feature = "RequestCredentials")]
36    #[deprecated = "Use `set_credentials()` instead."]
37    pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self {
38        self.set_credentials(val);
39        self
40    }
41}
42impl Default for WorkletOptions {
43    fn default() -> Self {
44        Self::new()
45    }
46}