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