web_sys/features/
gen_U2f.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 = U2F , typescript_type = "U2F")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `U2f` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/U2F)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
14 pub type U2f;
15 # [wasm_bindgen (catch , method , structural , js_class = "U2F" , js_name = register)]
16 #[doc = "The `register()` method."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/U2F/register)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
21 pub fn register(
22 this: &U2f,
23 app_id: &str,
24 register_requests: &::wasm_bindgen::JsValue,
25 registered_keys: &::wasm_bindgen::JsValue,
26 callback: &::js_sys::Function,
27 ) -> Result<(), JsValue>;
28 # [wasm_bindgen (catch , method , structural , js_class = "U2F" , js_name = register)]
29 #[doc = "The `register()` method."]
30 #[doc = ""]
31 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/U2F/register)"]
32 #[doc = ""]
33 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
34 pub fn register_with_opt_timeout_seconds(
35 this: &U2f,
36 app_id: &str,
37 register_requests: &::wasm_bindgen::JsValue,
38 registered_keys: &::wasm_bindgen::JsValue,
39 callback: &::js_sys::Function,
40 opt_timeout_seconds: Option<i32>,
41 ) -> Result<(), JsValue>;
42 # [wasm_bindgen (catch , method , structural , js_class = "U2F" , js_name = sign)]
43 #[doc = "The `sign()` method."]
44 #[doc = ""]
45 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/U2F/sign)"]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
48 pub fn sign(
49 this: &U2f,
50 app_id: &str,
51 challenge: &str,
52 registered_keys: &::wasm_bindgen::JsValue,
53 callback: &::js_sys::Function,
54 ) -> Result<(), JsValue>;
55 # [wasm_bindgen (catch , method , structural , js_class = "U2F" , js_name = sign)]
56 #[doc = "The `sign()` method."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/U2F/sign)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
61 pub fn sign_with_opt_timeout_seconds(
62 this: &U2f,
63 app_id: &str,
64 challenge: &str,
65 registered_keys: &::wasm_bindgen::JsValue,
66 callback: &::js_sys::Function,
67 opt_timeout_seconds: Option<i32>,
68 ) -> Result<(), JsValue>;
69}
70impl U2f {
71 #[doc = "The `U2F.OK` const."]
72 #[doc = ""]
73 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
74 pub const OK: u16 = 0i64 as u16;
75 #[doc = "The `U2F.OTHER_ERROR` const."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
78 pub const OTHER_ERROR: u16 = 1u64 as u16;
79 #[doc = "The `U2F.BAD_REQUEST` const."]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
82 pub const BAD_REQUEST: u16 = 2u64 as u16;
83 #[doc = "The `U2F.CONFIGURATION_UNSUPPORTED` const."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
86 pub const CONFIGURATION_UNSUPPORTED: u16 = 3u64 as u16;
87 #[doc = "The `U2F.DEVICE_INELIGIBLE` const."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
90 pub const DEVICE_INELIGIBLE: u16 = 4u64 as u16;
91 #[doc = "The `U2F.TIMEOUT` const."]
92 #[doc = ""]
93 #[doc = "*This API requires the following crate features to be activated: `U2f`*"]
94 pub const TIMEOUT: u16 = 5u64 as u16;
95}