web_sys/features/
gen_Hid.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 #[wasm_bindgen(
9 extends = "EventTarget",
10 extends = "::js_sys::Object",
11 js_name = "HID",
12 typescript_type = "HID"
13 )]
14 #[derive(Debug, Clone, PartialEq, Eq)]
15 #[doc = "The `Hid` class."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `Hid`*"]
20 #[doc = ""]
21 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
22 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
23 pub type Hid;
24 #[cfg(web_sys_unstable_apis)]
25 #[wasm_bindgen(method, getter, js_class = "HID", js_name = "onconnect")]
26 #[doc = "Getter for the `onconnect` field of this object."]
27 #[doc = ""]
28 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/onconnect)"]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `Hid`*"]
31 #[doc = ""]
32 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
33 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
34 pub fn onconnect(this: &Hid) -> Option<::js_sys::Function>;
35 #[cfg(web_sys_unstable_apis)]
36 #[wasm_bindgen(method, setter, js_class = "HID", js_name = "onconnect")]
37 #[doc = "Setter for the `onconnect` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/onconnect)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `Hid`*"]
42 #[doc = ""]
43 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45 pub fn set_onconnect(this: &Hid, value: Option<&::js_sys::Function>);
46 #[cfg(web_sys_unstable_apis)]
47 #[wasm_bindgen(method, getter, js_class = "HID", js_name = "ondisconnect")]
48 #[doc = "Getter for the `ondisconnect` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/ondisconnect)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `Hid`*"]
53 #[doc = ""]
54 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
56 pub fn ondisconnect(this: &Hid) -> Option<::js_sys::Function>;
57 #[cfg(web_sys_unstable_apis)]
58 #[wasm_bindgen(method, setter, js_class = "HID", js_name = "ondisconnect")]
59 #[doc = "Setter for the `ondisconnect` field of this object."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/ondisconnect)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `Hid`*"]
64 #[doc = ""]
65 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
67 pub fn set_ondisconnect(this: &Hid, value: Option<&::js_sys::Function>);
68 #[cfg(web_sys_unstable_apis)]
69 #[cfg(feature = "HidDevice")]
70 #[wasm_bindgen(method, js_class = "HID", js_name = "getDevices")]
71 #[doc = "The `getDevices()` method."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/getDevices)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `Hid`, `HidDevice`*"]
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 get_devices(this: &Hid) -> ::js_sys::Promise<::js_sys::Array<HidDevice>>;
80 #[cfg(web_sys_unstable_apis)]
81 #[cfg(all(feature = "HidDevice", feature = "HidDeviceRequestOptions",))]
82 #[wasm_bindgen(method, js_class = "HID", js_name = "requestDevice")]
83 #[doc = "The `requestDevice()` method."]
84 #[doc = ""]
85 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/requestDevice)"]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `Hid`, `HidDevice`, `HidDeviceRequestOptions`*"]
88 #[doc = ""]
89 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
91 pub fn request_device(
92 this: &Hid,
93 options: &HidDeviceRequestOptions,
94 ) -> ::js_sys::Promise<::js_sys::Array<HidDevice>>;
95}