Skip to main content

web_sys/features/
gen_PublicKeyCredential.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 = "Credential",
9        extends = "::js_sys::Object",
10        js_name = "PublicKeyCredential",
11        typescript_type = "PublicKeyCredential"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `PublicKeyCredential` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
19    pub type PublicKeyCredential;
20    #[wasm_bindgen(method, getter, js_class = "PublicKeyCredential", js_name = "rawId")]
21    #[doc = "Getter for the `rawId` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/rawId)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
26    pub fn raw_id(this: &PublicKeyCredential) -> ::js_sys::ArrayBuffer;
27    #[cfg(feature = "AuthenticatorResponse")]
28    #[wasm_bindgen(method, getter, js_class = "PublicKeyCredential", js_name = "response")]
29    #[doc = "Getter for the `response` field of this object."]
30    #[doc = ""]
31    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/response)"]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorResponse`, `PublicKeyCredential`*"]
34    pub fn response(this: &PublicKeyCredential) -> AuthenticatorResponse;
35    #[cfg(web_sys_unstable_apis)]
36    #[wasm_bindgen(
37        method,
38        getter,
39        js_class = "PublicKeyCredential",
40        js_name = "authenticatorAttachment"
41    )]
42    #[doc = "Getter for the `authenticatorAttachment` field of this object."]
43    #[doc = ""]
44    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/authenticatorAttachment)"]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
47    #[doc = ""]
48    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
49    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
50    pub fn authenticator_attachment(this: &PublicKeyCredential) -> Option<::alloc::string::String>;
51    #[cfg(feature = "AuthenticationExtensionsClientOutputs")]
52    #[wasm_bindgen(
53        method,
54        js_class = "PublicKeyCredential",
55        js_name = "getClientExtensionResults"
56    )]
57    #[doc = "The `getClientExtensionResults()` method."]
58    #[doc = ""]
59    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/getClientExtensionResults)"]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `PublicKeyCredential`*"]
62    pub fn get_client_extension_results(
63        this: &PublicKeyCredential,
64    ) -> AuthenticationExtensionsClientOutputs;
65    #[cfg(web_sys_unstable_apis)]
66    #[wasm_bindgen(
67        static_method_of = "PublicKeyCredential",
68        js_class = "PublicKeyCredential",
69        js_name = "isConditionalMediationAvailable"
70    )]
71    #[doc = "The `isConditionalMediationAvailable()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isConditionalMediationAvailable_static)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
76    #[doc = ""]
77    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
79    pub fn is_conditional_mediation_available() -> ::js_sys::Promise<::js_sys::Boolean>;
80    #[cfg(web_sys_unstable_apis)]
81    #[wasm_bindgen(
82        static_method_of = "PublicKeyCredential",
83        js_class = "PublicKeyCredential",
84        js_name = "isPasskeyPlatformAuthenticatorAvailable"
85    )]
86    #[doc = "The `isPasskeyPlatformAuthenticatorAvailable()` method."]
87    #[doc = ""]
88    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isPasskeyPlatformAuthenticatorAvailable_static)"]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
91    #[doc = ""]
92    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
93    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
94    pub fn is_passkey_platform_authenticator_available() -> ::js_sys::Promise<::js_sys::Boolean>;
95    #[wasm_bindgen(
96        static_method_of = "PublicKeyCredential",
97        js_class = "PublicKeyCredential",
98        js_name = "isUserVerifyingPlatformAuthenticatorAvailable"
99    )]
100    #[doc = "The `isUserVerifyingPlatformAuthenticatorAvailable()` method."]
101    #[doc = ""]
102    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isUserVerifyingPlatformAuthenticatorAvailable_static)"]
103    #[doc = ""]
104    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
105    pub fn is_user_verifying_platform_authenticator_available() -> ::js_sys::Promise;
106    #[cfg(web_sys_unstable_apis)]
107    #[cfg(all(
108        feature = "PublicKeyCredentialCreationOptions",
109        feature = "PublicKeyCredentialCreationOptionsJson",
110    ))]
111    #[wasm_bindgen(
112        catch,
113        static_method_of = "PublicKeyCredential",
114        js_class = "PublicKeyCredential",
115        js_name = "parseCreationOptionsFromJSON"
116    )]
117    #[doc = "The `parseCreationOptionsFromJSON()` method."]
118    #[doc = ""]
119    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/parseCreationOptionsFromJSON_static)"]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`, `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialCreationOptionsJson`*"]
122    #[doc = ""]
123    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
125    pub fn parse_creation_options_from_json(
126        options: &PublicKeyCredentialCreationOptionsJson,
127    ) -> Result<PublicKeyCredentialCreationOptions, JsValue>;
128    #[cfg(web_sys_unstable_apis)]
129    #[cfg(all(
130        feature = "PublicKeyCredentialRequestOptions",
131        feature = "PublicKeyCredentialRequestOptionsJson",
132    ))]
133    #[wasm_bindgen(
134        catch,
135        static_method_of = "PublicKeyCredential",
136        js_class = "PublicKeyCredential",
137        js_name = "parseRequestOptionsFromJSON"
138    )]
139    #[doc = "The `parseRequestOptionsFromJSON()` method."]
140    #[doc = ""]
141    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/parseRequestOptionsFromJSON_static)"]
142    #[doc = ""]
143    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`, `PublicKeyCredentialRequestOptions`, `PublicKeyCredentialRequestOptionsJson`*"]
144    #[doc = ""]
145    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
146    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
147    pub fn parse_request_options_from_json(
148        options: &PublicKeyCredentialRequestOptionsJson,
149    ) -> Result<PublicKeyCredentialRequestOptions, JsValue>;
150    #[cfg(web_sys_unstable_apis)]
151    #[wasm_bindgen(catch, method, js_class = "PublicKeyCredential", js_name = "toJSON")]
152    #[doc = "The `toJSON()` method."]
153    #[doc = ""]
154    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/toJSON)"]
155    #[doc = ""]
156    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"]
157    #[doc = ""]
158    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
159    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
160    pub fn to_json(this: &PublicKeyCredential) -> Result<::wasm_bindgen::JsValue, JsValue>;
161}