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 = "::js_sys::Object",
10 js_name = "USBDevice",
11 typescript_type = "USBDevice"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `UsbDevice` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
19 #[doc = ""]
20 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
21 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
22 pub type UsbDevice;
23 #[cfg(web_sys_unstable_apis)]
24 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "usbVersionMajor")]
25 #[doc = "Getter for the `usbVersionMajor` field of this object."]
26 #[doc = ""]
27 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/usbVersionMajor)"]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 pub fn usb_version_major(this: &UsbDevice) -> u8;
34 #[cfg(web_sys_unstable_apis)]
35 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "usbVersionMinor")]
36 #[doc = "Getter for the `usbVersionMinor` field of this object."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/usbVersionMinor)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
41 #[doc = ""]
42 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 pub fn usb_version_minor(this: &UsbDevice) -> u8;
45 #[cfg(web_sys_unstable_apis)]
46 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "usbVersionSubminor")]
47 #[doc = "Getter for the `usbVersionSubminor` field of this object."]
48 #[doc = ""]
49 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/usbVersionSubminor)"]
50 #[doc = ""]
51 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
52 #[doc = ""]
53 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
55 pub fn usb_version_subminor(this: &UsbDevice) -> u8;
56 #[cfg(web_sys_unstable_apis)]
57 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "deviceClass")]
58 #[doc = "Getter for the `deviceClass` field of this object."]
59 #[doc = ""]
60 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/deviceClass)"]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
63 #[doc = ""]
64 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
65 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
66 pub fn device_class(this: &UsbDevice) -> u8;
67 #[cfg(web_sys_unstable_apis)]
68 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "deviceSubclass")]
69 #[doc = "Getter for the `deviceSubclass` field of this object."]
70 #[doc = ""]
71 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/deviceSubclass)"]
72 #[doc = ""]
73 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
74 #[doc = ""]
75 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
76 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
77 pub fn device_subclass(this: &UsbDevice) -> u8;
78 #[cfg(web_sys_unstable_apis)]
79 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "deviceProtocol")]
80 #[doc = "Getter for the `deviceProtocol` field of this object."]
81 #[doc = ""]
82 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/deviceProtocol)"]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
85 #[doc = ""]
86 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
87 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
88 pub fn device_protocol(this: &UsbDevice) -> u8;
89 #[cfg(web_sys_unstable_apis)]
90 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "vendorId")]
91 #[doc = "Getter for the `vendorId` field of this object."]
92 #[doc = ""]
93 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/vendorId)"]
94 #[doc = ""]
95 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
96 #[doc = ""]
97 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
98 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
99 pub fn vendor_id(this: &UsbDevice) -> u16;
100 #[cfg(web_sys_unstable_apis)]
101 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "productId")]
102 #[doc = "Getter for the `productId` field of this object."]
103 #[doc = ""]
104 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/productId)"]
105 #[doc = ""]
106 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
107 #[doc = ""]
108 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
109 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
110 pub fn product_id(this: &UsbDevice) -> u16;
111 #[cfg(web_sys_unstable_apis)]
112 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "deviceVersionMajor")]
113 #[doc = "Getter for the `deviceVersionMajor` field of this object."]
114 #[doc = ""]
115 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/deviceVersionMajor)"]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
118 #[doc = ""]
119 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
120 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
121 pub fn device_version_major(this: &UsbDevice) -> u8;
122 #[cfg(web_sys_unstable_apis)]
123 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "deviceVersionMinor")]
124 #[doc = "Getter for the `deviceVersionMinor` field of this object."]
125 #[doc = ""]
126 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/deviceVersionMinor)"]
127 #[doc = ""]
128 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
129 #[doc = ""]
130 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
131 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
132 pub fn device_version_minor(this: &UsbDevice) -> u8;
133 #[cfg(web_sys_unstable_apis)]
134 #[wasm_bindgen(
135 method,
136 getter,
137 js_class = "USBDevice",
138 js_name = "deviceVersionSubminor"
139 )]
140 #[doc = "Getter for the `deviceVersionSubminor` field of this object."]
141 #[doc = ""]
142 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/deviceVersionSubminor)"]
143 #[doc = ""]
144 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
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 device_version_subminor(this: &UsbDevice) -> u8;
149 #[cfg(web_sys_unstable_apis)]
150 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "manufacturerName")]
151 #[doc = "Getter for the `manufacturerName` field of this object."]
152 #[doc = ""]
153 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/manufacturerName)"]
154 #[doc = ""]
155 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
156 #[doc = ""]
157 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
158 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
159 pub fn manufacturer_name(this: &UsbDevice) -> Option<::alloc::string::String>;
160 #[cfg(web_sys_unstable_apis)]
161 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "productName")]
162 #[doc = "Getter for the `productName` field of this object."]
163 #[doc = ""]
164 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/productName)"]
165 #[doc = ""]
166 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
167 #[doc = ""]
168 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
169 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
170 pub fn product_name(this: &UsbDevice) -> Option<::alloc::string::String>;
171 #[cfg(web_sys_unstable_apis)]
172 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "serialNumber")]
173 #[doc = "Getter for the `serialNumber` field of this object."]
174 #[doc = ""]
175 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/serialNumber)"]
176 #[doc = ""]
177 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
178 #[doc = ""]
179 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
180 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
181 pub fn serial_number(this: &UsbDevice) -> Option<::alloc::string::String>;
182 #[cfg(web_sys_unstable_apis)]
183 #[cfg(feature = "UsbConfiguration")]
184 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "configuration")]
185 #[doc = "Getter for the `configuration` field of this object."]
186 #[doc = ""]
187 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/configuration)"]
188 #[doc = ""]
189 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`, `UsbDevice`*"]
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 configuration(this: &UsbDevice) -> Option<UsbConfiguration>;
194 #[cfg(web_sys_unstable_apis)]
195 #[cfg(feature = "UsbConfiguration")]
196 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "configurations")]
197 #[doc = "Getter for the `configurations` field of this object."]
198 #[doc = ""]
199 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/configurations)"]
200 #[doc = ""]
201 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`, `UsbDevice`*"]
202 #[doc = ""]
203 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
204 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
205 pub fn configurations(this: &UsbDevice) -> ::js_sys::Array<UsbConfiguration>;
206 #[cfg(web_sys_unstable_apis)]
207 #[wasm_bindgen(method, getter, js_class = "USBDevice", js_name = "opened")]
208 #[doc = "Getter for the `opened` field of this object."]
209 #[doc = ""]
210 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/opened)"]
211 #[doc = ""]
212 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
213 #[doc = ""]
214 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
215 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
216 pub fn opened(this: &UsbDevice) -> bool;
217 #[cfg(web_sys_unstable_apis)]
218 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "claimInterface")]
219 #[doc = "The `claimInterface()` method."]
220 #[doc = ""]
221 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/claimInterface)"]
222 #[doc = ""]
223 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
224 #[doc = ""]
225 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
226 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
227 pub fn claim_interface(
228 this: &UsbDevice,
229 interface_number: u8,
230 ) -> ::js_sys::Promise<::js_sys::Undefined>;
231 #[cfg(web_sys_unstable_apis)]
232 #[cfg(feature = "UsbDirection")]
233 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "clearHalt")]
234 #[doc = "The `clearHalt()` method."]
235 #[doc = ""]
236 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/clearHalt)"]
237 #[doc = ""]
238 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbDirection`*"]
239 #[doc = ""]
240 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
241 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
242 pub fn clear_halt(
243 this: &UsbDevice,
244 direction: UsbDirection,
245 endpoint_number: u8,
246 ) -> ::js_sys::Promise<::js_sys::Undefined>;
247 #[cfg(web_sys_unstable_apis)]
248 #[wasm_bindgen(method, js_class = "USBDevice")]
249 #[doc = "The `close()` method."]
250 #[doc = ""]
251 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/close)"]
252 #[doc = ""]
253 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
254 #[doc = ""]
255 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
256 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
257 pub fn close(this: &UsbDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
258 #[cfg(web_sys_unstable_apis)]
259 #[cfg(all(
260 feature = "UsbControlTransferParameters",
261 feature = "UsbInTransferResult",
262 ))]
263 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "controlTransferIn")]
264 #[doc = "The `controlTransferIn()` method."]
265 #[doc = ""]
266 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferIn)"]
267 #[doc = ""]
268 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbDevice`, `UsbInTransferResult`*"]
269 #[doc = ""]
270 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
271 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
272 pub fn control_transfer_in(
273 this: &UsbDevice,
274 setup: &UsbControlTransferParameters,
275 length: u16,
276 ) -> ::js_sys::Promise<UsbInTransferResult>;
277 #[cfg(web_sys_unstable_apis)]
278 #[cfg(all(
279 feature = "UsbControlTransferParameters",
280 feature = "UsbOutTransferResult",
281 ))]
282 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "controlTransferOut")]
283 #[doc = "The `controlTransferOut()` method."]
284 #[doc = ""]
285 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"]
286 #[doc = ""]
287 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbDevice`, `UsbOutTransferResult`*"]
288 #[doc = ""]
289 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
290 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
291 pub fn control_transfer_out(
292 this: &UsbDevice,
293 setup: &UsbControlTransferParameters,
294 ) -> ::js_sys::Promise<UsbOutTransferResult>;
295 #[cfg(web_sys_unstable_apis)]
296 #[cfg(all(
297 feature = "UsbControlTransferParameters",
298 feature = "UsbOutTransferResult",
299 ))]
300 #[wasm_bindgen(catch, method, js_class = "USBDevice", js_name = "controlTransferOut")]
301 #[doc = "The `controlTransferOut()` method."]
302 #[doc = ""]
303 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"]
304 #[doc = ""]
305 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbDevice`, `UsbOutTransferResult`*"]
306 #[doc = ""]
307 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
308 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
309 pub fn control_transfer_out_with_buffer_source(
310 this: &UsbDevice,
311 setup: &UsbControlTransferParameters,
312 data: &::js_sys::Object,
313 ) -> Result<::js_sys::Promise<UsbOutTransferResult>, JsValue>;
314 #[cfg(web_sys_unstable_apis)]
315 #[cfg(all(
316 feature = "UsbControlTransferParameters",
317 feature = "UsbOutTransferResult",
318 ))]
319 #[wasm_bindgen(catch, method, js_class = "USBDevice", js_name = "controlTransferOut")]
320 #[doc = "The `controlTransferOut()` method."]
321 #[doc = ""]
322 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"]
323 #[doc = ""]
324 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbDevice`, `UsbOutTransferResult`*"]
325 #[doc = ""]
326 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
327 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
328 pub fn control_transfer_out_with_u8_slice(
329 this: &UsbDevice,
330 setup: &UsbControlTransferParameters,
331 data: &mut [u8],
332 ) -> Result<::js_sys::Promise<UsbOutTransferResult>, JsValue>;
333 #[cfg(web_sys_unstable_apis)]
334 #[cfg(all(
335 feature = "UsbControlTransferParameters",
336 feature = "UsbOutTransferResult",
337 ))]
338 #[wasm_bindgen(catch, method, js_class = "USBDevice", js_name = "controlTransferOut")]
339 #[doc = "The `controlTransferOut()` method."]
340 #[doc = ""]
341 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"]
342 #[doc = ""]
343 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbDevice`, `UsbOutTransferResult`*"]
344 #[doc = ""]
345 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
346 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
347 pub fn control_transfer_out_with_u8_array(
348 this: &UsbDevice,
349 setup: &UsbControlTransferParameters,
350 data: &::js_sys::Uint8Array,
351 ) -> Result<::js_sys::Promise<UsbOutTransferResult>, JsValue>;
352 #[cfg(web_sys_unstable_apis)]
353 #[wasm_bindgen(method, js_class = "USBDevice")]
354 #[doc = "The `forget()` method."]
355 #[doc = ""]
356 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/forget)"]
357 #[doc = ""]
358 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
359 #[doc = ""]
360 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
361 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
362 pub fn forget(this: &UsbDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
363 #[cfg(web_sys_unstable_apis)]
364 #[cfg(feature = "UsbIsochronousInTransferResult")]
365 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "isochronousTransferIn")]
366 #[doc = "The `isochronousTransferIn()` method."]
367 #[doc = ""]
368 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferIn)"]
369 #[doc = ""]
370 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbIsochronousInTransferResult`*"]
371 #[doc = ""]
372 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
373 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
374 pub fn isochronous_transfer_in(
375 this: &UsbDevice,
376 endpoint_number: u8,
377 packet_lengths: &[::js_sys::Number],
378 ) -> ::js_sys::Promise<UsbIsochronousInTransferResult>;
379 #[cfg(web_sys_unstable_apis)]
380 #[cfg(feature = "UsbIsochronousOutTransferResult")]
381 #[wasm_bindgen(
382 catch,
383 method,
384 js_class = "USBDevice",
385 js_name = "isochronousTransferOut"
386 )]
387 #[doc = "The `isochronousTransferOut()` method."]
388 #[doc = ""]
389 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferOut)"]
390 #[doc = ""]
391 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbIsochronousOutTransferResult`*"]
392 #[doc = ""]
393 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
394 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
395 pub fn isochronous_transfer_out_with_buffer_source(
396 this: &UsbDevice,
397 endpoint_number: u8,
398 data: &::js_sys::Object,
399 packet_lengths: &[::js_sys::Number],
400 ) -> Result<::js_sys::Promise<UsbIsochronousOutTransferResult>, JsValue>;
401 #[cfg(web_sys_unstable_apis)]
402 #[cfg(feature = "UsbIsochronousOutTransferResult")]
403 #[wasm_bindgen(
404 catch,
405 method,
406 js_class = "USBDevice",
407 js_name = "isochronousTransferOut"
408 )]
409 #[doc = "The `isochronousTransferOut()` method."]
410 #[doc = ""]
411 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferOut)"]
412 #[doc = ""]
413 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbIsochronousOutTransferResult`*"]
414 #[doc = ""]
415 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
416 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
417 pub fn isochronous_transfer_out_with_u8_slice(
418 this: &UsbDevice,
419 endpoint_number: u8,
420 data: &mut [u8],
421 packet_lengths: &[::js_sys::Number],
422 ) -> Result<::js_sys::Promise<UsbIsochronousOutTransferResult>, JsValue>;
423 #[cfg(web_sys_unstable_apis)]
424 #[cfg(feature = "UsbIsochronousOutTransferResult")]
425 #[wasm_bindgen(
426 catch,
427 method,
428 js_class = "USBDevice",
429 js_name = "isochronousTransferOut"
430 )]
431 #[doc = "The `isochronousTransferOut()` method."]
432 #[doc = ""]
433 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferOut)"]
434 #[doc = ""]
435 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbIsochronousOutTransferResult`*"]
436 #[doc = ""]
437 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
438 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
439 pub fn isochronous_transfer_out_with_u8_array(
440 this: &UsbDevice,
441 endpoint_number: u8,
442 data: &::js_sys::Uint8Array,
443 packet_lengths: &[::js_sys::Number],
444 ) -> Result<::js_sys::Promise<UsbIsochronousOutTransferResult>, JsValue>;
445 #[cfg(web_sys_unstable_apis)]
446 #[wasm_bindgen(method, js_class = "USBDevice")]
447 #[doc = "The `open()` method."]
448 #[doc = ""]
449 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/open)"]
450 #[doc = ""]
451 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
452 #[doc = ""]
453 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
454 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
455 pub fn open(this: &UsbDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
456 #[cfg(web_sys_unstable_apis)]
457 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "releaseInterface")]
458 #[doc = "The `releaseInterface()` method."]
459 #[doc = ""]
460 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/releaseInterface)"]
461 #[doc = ""]
462 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
463 #[doc = ""]
464 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
465 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
466 pub fn release_interface(
467 this: &UsbDevice,
468 interface_number: u8,
469 ) -> ::js_sys::Promise<::js_sys::Undefined>;
470 #[cfg(web_sys_unstable_apis)]
471 #[wasm_bindgen(method, js_class = "USBDevice")]
472 #[doc = "The `reset()` method."]
473 #[doc = ""]
474 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/reset)"]
475 #[doc = ""]
476 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
477 #[doc = ""]
478 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
479 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
480 pub fn reset(this: &UsbDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
481 #[cfg(web_sys_unstable_apis)]
482 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "selectAlternateInterface")]
483 #[doc = "The `selectAlternateInterface()` method."]
484 #[doc = ""]
485 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/selectAlternateInterface)"]
486 #[doc = ""]
487 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
488 #[doc = ""]
489 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
490 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
491 pub fn select_alternate_interface(
492 this: &UsbDevice,
493 interface_number: u8,
494 alternate_setting: u8,
495 ) -> ::js_sys::Promise<::js_sys::Undefined>;
496 #[cfg(web_sys_unstable_apis)]
497 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "selectConfiguration")]
498 #[doc = "The `selectConfiguration()` method."]
499 #[doc = ""]
500 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/selectConfiguration)"]
501 #[doc = ""]
502 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"]
503 #[doc = ""]
504 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
505 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
506 pub fn select_configuration(
507 this: &UsbDevice,
508 configuration_value: u8,
509 ) -> ::js_sys::Promise<::js_sys::Undefined>;
510 #[cfg(web_sys_unstable_apis)]
511 #[cfg(feature = "UsbInTransferResult")]
512 #[wasm_bindgen(method, js_class = "USBDevice", js_name = "transferIn")]
513 #[doc = "The `transferIn()` method."]
514 #[doc = ""]
515 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferIn)"]
516 #[doc = ""]
517 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbInTransferResult`*"]
518 #[doc = ""]
519 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
520 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
521 pub fn transfer_in(
522 this: &UsbDevice,
523 endpoint_number: u8,
524 length: u32,
525 ) -> ::js_sys::Promise<UsbInTransferResult>;
526 #[cfg(web_sys_unstable_apis)]
527 #[cfg(feature = "UsbOutTransferResult")]
528 #[wasm_bindgen(catch, method, js_class = "USBDevice", js_name = "transferOut")]
529 #[doc = "The `transferOut()` method."]
530 #[doc = ""]
531 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferOut)"]
532 #[doc = ""]
533 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbOutTransferResult`*"]
534 #[doc = ""]
535 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
536 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
537 pub fn transfer_out_with_buffer_source(
538 this: &UsbDevice,
539 endpoint_number: u8,
540 data: &::js_sys::Object,
541 ) -> Result<::js_sys::Promise<UsbOutTransferResult>, JsValue>;
542 #[cfg(web_sys_unstable_apis)]
543 #[cfg(feature = "UsbOutTransferResult")]
544 #[wasm_bindgen(catch, method, js_class = "USBDevice", js_name = "transferOut")]
545 #[doc = "The `transferOut()` method."]
546 #[doc = ""]
547 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferOut)"]
548 #[doc = ""]
549 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbOutTransferResult`*"]
550 #[doc = ""]
551 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
552 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
553 pub fn transfer_out_with_u8_slice(
554 this: &UsbDevice,
555 endpoint_number: u8,
556 data: &mut [u8],
557 ) -> Result<::js_sys::Promise<UsbOutTransferResult>, JsValue>;
558 #[cfg(web_sys_unstable_apis)]
559 #[cfg(feature = "UsbOutTransferResult")]
560 #[wasm_bindgen(catch, method, js_class = "USBDevice", js_name = "transferOut")]
561 #[doc = "The `transferOut()` method."]
562 #[doc = ""]
563 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferOut)"]
564 #[doc = ""]
565 #[doc = "*This API requires the following crate features to be activated: `UsbDevice`, `UsbOutTransferResult`*"]
566 #[doc = ""]
567 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
568 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
569 pub fn transfer_out_with_u8_array(
570 this: &UsbDevice,
571 endpoint_number: u8,
572 data: &::js_sys::Uint8Array,
573 ) -> Result<::js_sys::Promise<UsbOutTransferResult>, JsValue>;
574}