web_sys/features/
gen_PublicKeyCredentialRequestOptions.rs1#![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 = "PublicKeyCredentialRequestOptions"
10 )]
11 #[derive(Debug, Clone, PartialEq, Eq)]
12 #[doc = "The `PublicKeyCredentialRequestOptions` dictionary."]
13 #[doc = ""]
14 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
15 pub type PublicKeyCredentialRequestOptions;
16 #[doc = "Get the `allowCredentials` field of this object."]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
19 #[wasm_bindgen(method, getter = "allowCredentials")]
20 pub fn get_allow_credentials(
21 this: &PublicKeyCredentialRequestOptions,
22 ) -> Option<::js_sys::Array>;
23 #[doc = "Change the `allowCredentials` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
26 #[wasm_bindgen(method, setter = "allowCredentials")]
27 pub fn set_allow_credentials(
28 this: &PublicKeyCredentialRequestOptions,
29 val: &::wasm_bindgen::JsValue,
30 );
31 #[cfg(web_sys_unstable_apis)]
32 #[doc = "Get the `attestation` field of this object."]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
35 #[doc = ""]
36 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
37 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
38 #[wasm_bindgen(method, getter = "attestation")]
39 pub fn get_attestation(
40 this: &PublicKeyCredentialRequestOptions,
41 ) -> Option<::alloc::string::String>;
42 #[cfg(web_sys_unstable_apis)]
43 #[doc = "Change the `attestation` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
46 #[doc = ""]
47 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
48 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
49 #[wasm_bindgen(method, setter = "attestation")]
50 pub fn set_attestation(this: &PublicKeyCredentialRequestOptions, val: &str);
51 #[cfg(web_sys_unstable_apis)]
52 #[doc = "Get the `attestationFormats` field of this object."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
55 #[doc = ""]
56 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
58 #[wasm_bindgen(method, getter = "attestationFormats")]
59 pub fn get_attestation_formats(
60 this: &PublicKeyCredentialRequestOptions,
61 ) -> Option<::js_sys::Array<::js_sys::JsString>>;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `attestationFormats` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "attestationFormats")]
70 pub fn set_attestation_formats(
71 this: &PublicKeyCredentialRequestOptions,
72 val: &[::js_sys::JsString],
73 );
74 #[doc = "Get the `challenge` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
77 #[wasm_bindgen(method, getter = "challenge")]
78 pub fn get_challenge(this: &PublicKeyCredentialRequestOptions) -> ::js_sys::Object;
79 #[doc = "Change the `challenge` field of this object."]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
82 #[wasm_bindgen(method, setter = "challenge")]
83 pub fn set_challenge(this: &PublicKeyCredentialRequestOptions, val: &::js_sys::Object);
84 #[doc = "Change the `challenge` field of this object."]
85 #[doc = ""]
86 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
87 #[wasm_bindgen(method, setter = "challenge")]
88 pub fn set_challenge_buffer_source(
89 this: &PublicKeyCredentialRequestOptions,
90 val: &::js_sys::Object,
91 );
92 #[doc = "Change the `challenge` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
95 #[wasm_bindgen(method, setter = "challenge")]
96 pub fn set_challenge_u8_slice(this: &PublicKeyCredentialRequestOptions, val: &mut [u8]);
97 #[doc = "Change the `challenge` field of this object."]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
100 #[wasm_bindgen(method, setter = "challenge")]
101 pub fn set_challenge_u8_array(
102 this: &PublicKeyCredentialRequestOptions,
103 val: &::js_sys::Uint8Array,
104 );
105 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
106 #[doc = "Get the `extensions` field of this object."]
107 #[doc = ""]
108 #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"]
109 #[wasm_bindgen(method, getter = "extensions")]
110 pub fn get_extensions(
111 this: &PublicKeyCredentialRequestOptions,
112 ) -> Option<AuthenticationExtensionsClientInputs>;
113 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
114 #[doc = "Change the `extensions` field of this object."]
115 #[doc = ""]
116 #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"]
117 #[wasm_bindgen(method, setter = "extensions")]
118 pub fn set_extensions(
119 this: &PublicKeyCredentialRequestOptions,
120 val: &AuthenticationExtensionsClientInputs,
121 );
122 #[cfg(web_sys_unstable_apis)]
123 #[doc = "Get the `hints` field of this object."]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
126 #[doc = ""]
127 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
128 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
129 #[wasm_bindgen(method, getter = "hints")]
130 pub fn get_hints(
131 this: &PublicKeyCredentialRequestOptions,
132 ) -> Option<::js_sys::Array<::js_sys::JsString>>;
133 #[cfg(web_sys_unstable_apis)]
134 #[doc = "Change the `hints` field of this object."]
135 #[doc = ""]
136 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
137 #[doc = ""]
138 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
139 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
140 #[wasm_bindgen(method, setter = "hints")]
141 pub fn set_hints(this: &PublicKeyCredentialRequestOptions, val: &[::js_sys::JsString]);
142 #[doc = "Get the `rpId` field of this object."]
143 #[doc = ""]
144 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
145 #[wasm_bindgen(method, getter = "rpId")]
146 pub fn get_rp_id(this: &PublicKeyCredentialRequestOptions) -> Option<::alloc::string::String>;
147 #[doc = "Change the `rpId` field of this object."]
148 #[doc = ""]
149 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
150 #[wasm_bindgen(method, setter = "rpId")]
151 pub fn set_rp_id(this: &PublicKeyCredentialRequestOptions, val: &str);
152 #[doc = "Get the `timeout` field of this object."]
153 #[doc = ""]
154 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
155 #[wasm_bindgen(method, getter = "timeout")]
156 pub fn get_timeout(this: &PublicKeyCredentialRequestOptions) -> Option<u32>;
157 #[doc = "Change the `timeout` field of this object."]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
160 #[wasm_bindgen(method, setter = "timeout")]
161 pub fn set_timeout(this: &PublicKeyCredentialRequestOptions, val: u32);
162 #[cfg(feature = "UserVerificationRequirement")]
163 #[doc = "Get the `userVerification` field of this object."]
164 #[doc = ""]
165 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"]
166 #[wasm_bindgen(method, getter = "userVerification")]
167 pub fn get_user_verification(
168 this: &PublicKeyCredentialRequestOptions,
169 ) -> Option<UserVerificationRequirement>;
170 #[cfg(feature = "UserVerificationRequirement")]
171 #[doc = "Change the `userVerification` field of this object."]
172 #[doc = ""]
173 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"]
174 #[wasm_bindgen(method, setter = "userVerification")]
175 pub fn set_user_verification(
176 this: &PublicKeyCredentialRequestOptions,
177 val: UserVerificationRequirement,
178 );
179}
180impl PublicKeyCredentialRequestOptions {
181 #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
182 #[doc = ""]
183 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
184 pub fn new(challenge: &::js_sys::Object) -> Self {
185 #[allow(unused_mut)]
186 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
187 ret.set_challenge(challenge);
188 ret
189 }
190 #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
191 #[doc = ""]
192 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
193 pub fn new_with_u8_slice(challenge: &mut [u8]) -> Self {
194 #[allow(unused_mut)]
195 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
196 ret.set_challenge_u8_slice(challenge);
197 ret
198 }
199 #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
200 #[doc = ""]
201 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
202 pub fn new_with_u8_array(challenge: &::js_sys::Uint8Array) -> Self {
203 #[allow(unused_mut)]
204 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
205 ret.set_challenge_u8_array(challenge);
206 ret
207 }
208 #[deprecated = "Use `set_allow_credentials()` instead."]
209 pub fn allow_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
210 self.set_allow_credentials(val);
211 self
212 }
213 #[cfg(web_sys_unstable_apis)]
214 #[deprecated = "Use `set_attestation()` instead."]
215 pub fn attestation(&mut self, val: &str) -> &mut Self {
216 self.set_attestation(val);
217 self
218 }
219 #[cfg(web_sys_unstable_apis)]
220 #[deprecated = "Use `set_attestation_formats()` instead."]
221 pub fn attestation_formats(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
222 self.set_attestation_formats(val);
223 self
224 }
225 #[deprecated = "Use `set_challenge()` instead."]
226 pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self {
227 self.set_challenge(val);
228 self
229 }
230 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
231 #[deprecated = "Use `set_extensions()` instead."]
232 pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self {
233 self.set_extensions(val);
234 self
235 }
236 #[cfg(web_sys_unstable_apis)]
237 #[deprecated = "Use `set_hints()` instead."]
238 pub fn hints(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
239 self.set_hints(val);
240 self
241 }
242 #[deprecated = "Use `set_rp_id()` instead."]
243 pub fn rp_id(&mut self, val: &str) -> &mut Self {
244 self.set_rp_id(val);
245 self
246 }
247 #[deprecated = "Use `set_timeout()` instead."]
248 pub fn timeout(&mut self, val: u32) -> &mut Self {
249 self.set_timeout(val);
250 self
251 }
252 #[cfg(feature = "UserVerificationRequirement")]
253 #[deprecated = "Use `set_user_verification()` instead."]
254 pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self {
255 self.set_user_verification(val);
256 self
257 }
258}