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