Skip to main content

web_sys/features/
gen_PublicKeyCredentialParameters.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 = "::js_sys::Object",
9        js_name = "PublicKeyCredentialParameters"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `PublicKeyCredentialParameters` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"]
15    pub type PublicKeyCredentialParameters;
16    #[doc = "Get the `alg` field of this object."]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"]
19    #[wasm_bindgen(method, getter = "alg")]
20    pub fn get_alg(this: &PublicKeyCredentialParameters) -> i32;
21    #[doc = "Change the `alg` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"]
24    #[wasm_bindgen(method, setter = "alg")]
25    pub fn set_alg(this: &PublicKeyCredentialParameters, val: i32);
26    #[cfg(feature = "PublicKeyCredentialType")]
27    #[doc = "Get the `type` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"]
30    #[wasm_bindgen(method, getter = "type")]
31    pub fn get_type(this: &PublicKeyCredentialParameters) -> PublicKeyCredentialType;
32    #[cfg(feature = "PublicKeyCredentialType")]
33    #[doc = "Change the `type` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"]
36    #[wasm_bindgen(method, setter = "type")]
37    pub fn set_type(this: &PublicKeyCredentialParameters, val: PublicKeyCredentialType);
38}
39impl PublicKeyCredentialParameters {
40    #[cfg(feature = "PublicKeyCredentialType")]
41    #[doc = "Construct a new `PublicKeyCredentialParameters`."]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"]
44    pub fn new(alg: i32, type_: PublicKeyCredentialType) -> Self {
45        #[allow(unused_mut)]
46        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
47        ret.set_alg(alg);
48        ret.set_type(type_);
49        ret
50    }
51    #[deprecated = "Use `set_alg()` instead."]
52    pub fn alg(&mut self, val: i32) -> &mut Self {
53        self.set_alg(val);
54        self
55    }
56    #[cfg(feature = "PublicKeyCredentialType")]
57    #[deprecated = "Use `set_type()` instead."]
58    pub fn type_(&mut self, val: PublicKeyCredentialType) -> &mut Self {
59        self.set_type(val);
60        self
61    }
62}