Skip to main content

web_sys/features/
gen_Usb.rs

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 = "USB",
12        typescript_type = "USB"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `Usb` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USB)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `Usb`*"]
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 Usb;
24    #[cfg(web_sys_unstable_apis)]
25    #[wasm_bindgen(method, getter, js_class = "USB", 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/USB/onconnect)"]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `Usb`*"]
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: &Usb) -> Option<::js_sys::Function>;
35    #[cfg(web_sys_unstable_apis)]
36    #[wasm_bindgen(method, setter, js_class = "USB", 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/USB/onconnect)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `Usb`*"]
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: &Usb, value: Option<&::js_sys::Function>);
46    #[cfg(web_sys_unstable_apis)]
47    #[wasm_bindgen(method, getter, js_class = "USB", 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/USB/ondisconnect)"]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `Usb`*"]
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: &Usb) -> Option<::js_sys::Function>;
57    #[cfg(web_sys_unstable_apis)]
58    #[wasm_bindgen(method, setter, js_class = "USB", 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/USB/ondisconnect)"]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `Usb`*"]
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: &Usb, value: Option<&::js_sys::Function>);
68    #[cfg(web_sys_unstable_apis)]
69    #[cfg(feature = "UsbDevice")]
70    #[wasm_bindgen(method, js_class = "USB", js_name = "getDevices")]
71    #[doc = "The `getDevices()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USB/getDevices)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `Usb`, `UsbDevice`*"]
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: &Usb) -> ::js_sys::Promise<::js_sys::Array<UsbDevice>>;
80    #[cfg(web_sys_unstable_apis)]
81    #[cfg(all(feature = "UsbDevice", feature = "UsbDeviceRequestOptions",))]
82    #[wasm_bindgen(method, js_class = "USB", js_name = "requestDevice")]
83    #[doc = "The `requestDevice()` method."]
84    #[doc = ""]
85    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USB/requestDevice)"]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `Usb`, `UsbDevice`, `UsbDeviceRequestOptions`*"]
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: &Usb,
93        options: &UsbDeviceRequestOptions,
94    ) -> ::js_sys::Promise<UsbDevice>;
95}