1#![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 (extends = EventTarget , extends = :: js_sys :: Object , js_name = HIDDevice , typescript_type = "HIDDevice")]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `HidDevice` class."]
11 #[doc = ""]
12 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice)"]
13 #[doc = ""]
14 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
15 #[doc = ""]
16 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
17 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
18 pub type HidDevice;
19 #[cfg(web_sys_unstable_apis)]
20 # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = oninputreport)]
21 #[doc = "Getter for the `oninputreport` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/oninputreport)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
26 #[doc = ""]
27 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
28 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
29 pub fn oninputreport(this: &HidDevice) -> Option<::js_sys::Function>;
30 #[cfg(web_sys_unstable_apis)]
31 # [wasm_bindgen (structural , method , setter , js_class = "HIDDevice" , js_name = oninputreport)]
32 #[doc = "Setter for the `oninputreport` field of this object."]
33 #[doc = ""]
34 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/oninputreport)"]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
37 #[doc = ""]
38 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
40 pub fn set_oninputreport(this: &HidDevice, value: Option<&::js_sys::Function>);
41 #[cfg(web_sys_unstable_apis)]
42 # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = opened)]
43 #[doc = "Getter for the `opened` field of this object."]
44 #[doc = ""]
45 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/opened)"]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 pub fn opened(this: &HidDevice) -> bool;
52 #[cfg(web_sys_unstable_apis)]
53 # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = vendorId)]
54 #[doc = "Getter for the `vendorId` field of this object."]
55 #[doc = ""]
56 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/vendorId)"]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 pub fn vendor_id(this: &HidDevice) -> u16;
63 #[cfg(web_sys_unstable_apis)]
64 # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = productId)]
65 #[doc = "Getter for the `productId` field of this object."]
66 #[doc = ""]
67 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/productId)"]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
70 #[doc = ""]
71 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 pub fn product_id(this: &HidDevice) -> u16;
74 #[cfg(web_sys_unstable_apis)]
75 # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = productName)]
76 #[doc = "Getter for the `productName` field of this object."]
77 #[doc = ""]
78 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/productName)"]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
81 #[doc = ""]
82 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
83 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
84 pub fn product_name(this: &HidDevice) -> ::alloc::string::String;
85 #[cfg(web_sys_unstable_apis)]
86 #[cfg(feature = "HidCollectionInfo")]
87 # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = collections)]
88 #[doc = "Getter for the `collections` field of this object."]
89 #[doc = ""]
90 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/collections)"]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidDevice`*"]
93 #[doc = ""]
94 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
96 pub fn collections(this: &HidDevice) -> ::js_sys::Array<HidCollectionInfo>;
97 #[cfg(web_sys_unstable_apis)]
98 # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = close)]
99 #[doc = "The `close()` method."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/close)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
104 #[doc = ""]
105 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 pub fn close(this: &HidDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
108 #[cfg(web_sys_unstable_apis)]
109 # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = open)]
110 #[doc = "The `open()` method."]
111 #[doc = ""]
112 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/open)"]
113 #[doc = ""]
114 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
115 #[doc = ""]
116 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
117 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
118 pub fn open(this: &HidDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
119 #[cfg(web_sys_unstable_apis)]
120 # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = receiveFeatureReport)]
121 #[doc = "The `receiveFeatureReport()` method."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/receiveFeatureReport)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
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 pub fn receive_feature_report(
130 this: &HidDevice,
131 report_id: u8,
132 ) -> ::js_sys::Promise<::js_sys::DataView>;
133 #[cfg(web_sys_unstable_apis)]
134 # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)]
135 #[doc = "The `sendFeatureReport()` method."]
136 #[doc = ""]
137 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendFeatureReport)"]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
140 #[doc = ""]
141 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
142 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
143 pub fn send_feature_report_with_buffer_source(
144 this: &HidDevice,
145 report_id: u8,
146 data: &::js_sys::Object,
147 ) -> Result<::js_sys::Promise<::js_sys::Undefined>, JsValue>;
148 #[cfg(web_sys_unstable_apis)]
149 # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)]
150 #[doc = "The `sendFeatureReport()` method."]
151 #[doc = ""]
152 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendFeatureReport)"]
153 #[doc = ""]
154 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
155 #[doc = ""]
156 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
157 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
158 pub fn send_feature_report_with_u8_slice(
159 this: &HidDevice,
160 report_id: u8,
161 data: &mut [u8],
162 ) -> Result<::js_sys::Promise<::js_sys::Undefined>, JsValue>;
163 #[cfg(web_sys_unstable_apis)]
164 # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)]
165 #[doc = "The `sendFeatureReport()` method."]
166 #[doc = ""]
167 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendFeatureReport)"]
168 #[doc = ""]
169 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
170 #[doc = ""]
171 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
172 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
173 pub fn send_feature_report_with_u8_array(
174 this: &HidDevice,
175 report_id: u8,
176 data: &::js_sys::Uint8Array,
177 ) -> Result<::js_sys::Promise<::js_sys::Undefined>, JsValue>;
178 #[cfg(web_sys_unstable_apis)]
179 # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendReport)]
180 #[doc = "The `sendReport()` method."]
181 #[doc = ""]
182 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendReport)"]
183 #[doc = ""]
184 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
185 #[doc = ""]
186 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
187 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
188 pub fn send_report_with_buffer_source(
189 this: &HidDevice,
190 report_id: u8,
191 data: &::js_sys::Object,
192 ) -> Result<::js_sys::Promise<::js_sys::Undefined>, JsValue>;
193 #[cfg(web_sys_unstable_apis)]
194 # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendReport)]
195 #[doc = "The `sendReport()` method."]
196 #[doc = ""]
197 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendReport)"]
198 #[doc = ""]
199 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
200 #[doc = ""]
201 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
202 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
203 pub fn send_report_with_u8_slice(
204 this: &HidDevice,
205 report_id: u8,
206 data: &mut [u8],
207 ) -> Result<::js_sys::Promise<::js_sys::Undefined>, JsValue>;
208 #[cfg(web_sys_unstable_apis)]
209 # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendReport)]
210 #[doc = "The `sendReport()` method."]
211 #[doc = ""]
212 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendReport)"]
213 #[doc = ""]
214 #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"]
215 #[doc = ""]
216 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
217 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
218 pub fn send_report_with_u8_array(
219 this: &HidDevice,
220 report_id: u8,
221 data: &::js_sys::Uint8Array,
222 ) -> Result<::js_sys::Promise<::js_sys::Undefined>, JsValue>;
223}