-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,880 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#![allow(unused_imports)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = HID , typescript_type = "HID")] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `Hid` class."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub type Hid; | ||
#[cfg(web_sys_unstable_apis)] | ||
# [wasm_bindgen (structural , method , getter , js_class = "HID" , js_name = onconnect)] | ||
#[doc = "Getter for the `onconnect` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/onconnect)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn onconnect(this: &Hid) -> Option<::js_sys::Function>; | ||
#[cfg(web_sys_unstable_apis)] | ||
# [wasm_bindgen (structural , method , setter , js_class = "HID" , js_name = onconnect)] | ||
#[doc = "Setter for the `onconnect` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/onconnect)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn set_onconnect(this: &Hid, value: Option<&::js_sys::Function>); | ||
#[cfg(web_sys_unstable_apis)] | ||
# [wasm_bindgen (structural , method , getter , js_class = "HID" , js_name = ondisconnect)] | ||
#[doc = "Getter for the `ondisconnect` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/ondisconnect)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn ondisconnect(this: &Hid) -> Option<::js_sys::Function>; | ||
#[cfg(web_sys_unstable_apis)] | ||
# [wasm_bindgen (structural , method , setter , js_class = "HID" , js_name = ondisconnect)] | ||
#[doc = "Setter for the `ondisconnect` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/ondisconnect)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn set_ondisconnect(this: &Hid, value: Option<&::js_sys::Function>); | ||
#[cfg(web_sys_unstable_apis)] | ||
# [wasm_bindgen (method , structural , js_class = "HID" , js_name = getDevices)] | ||
#[doc = "The `getDevices()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/getDevices)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn get_devices(this: &Hid) -> ::js_sys::Promise; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "HidDeviceRequestOptions")] | ||
# [wasm_bindgen (method , structural , js_class = "HID" , js_name = requestDevice)] | ||
#[doc = "The `requestDevice()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HID/requestDevice)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Hid`, `HidDeviceRequestOptions`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn request_device(this: &Hid, options: &HidDeviceRequestOptions) -> ::js_sys::Promise; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
#![allow(unused_imports)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = HIDCollectionInfo)] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `HidCollectionInfo` dictionary."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub type HidCollectionInfo; | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
impl HidCollectionInfo { | ||
#[doc = "Construct a new `HidCollectionInfo`."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn new() -> Self { | ||
#[allow(unused_mut)] | ||
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); | ||
ret | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `children` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn children(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set( | ||
self.as_ref(), | ||
&JsValue::from("children"), | ||
&JsValue::from(val), | ||
); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `featureReports` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn feature_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set( | ||
self.as_ref(), | ||
&JsValue::from("featureReports"), | ||
&JsValue::from(val), | ||
); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `inputReports` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn input_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set( | ||
self.as_ref(), | ||
&JsValue::from("inputReports"), | ||
&JsValue::from(val), | ||
); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `outputReports` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn output_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set( | ||
self.as_ref(), | ||
&JsValue::from("outputReports"), | ||
&JsValue::from(val), | ||
); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `type` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn type_(&mut self, val: u8) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `usage` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn usage(&mut self, val: u16) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `usagePage` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn usage_page(&mut self, val: u16) -> &mut Self { | ||
use wasm_bindgen::JsValue; | ||
let r = ::js_sys::Reflect::set( | ||
self.as_ref(), | ||
&JsValue::from("usagePage"), | ||
&JsValue::from(val), | ||
); | ||
debug_assert!( | ||
r.is_ok(), | ||
"setting properties should never fail on our dictionary objects" | ||
); | ||
let _ = r; | ||
self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#![allow(unused_imports)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = HIDConnectionEvent , typescript_type = "HIDConnectionEvent")] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `HidConnectionEvent` class."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDConnectionEvent)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidConnectionEvent`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub type HidConnectionEvent; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "HidDevice")] | ||
# [wasm_bindgen (structural , method , getter , js_class = "HIDConnectionEvent" , js_name = device)] | ||
#[doc = "Getter for the `device` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDConnectionEvent/device)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `HidConnectionEvent`, `HidDevice`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn device(this: &HidConnectionEvent) -> HidDevice; | ||
} |
Oops, something went wrong.