-
-
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.
Add WebIDL definitions for
InputDeviceInfo
and `MediaTrackCapabili…
…ties` (#3935) * Add WebIDL definitions for `InputDeviceInfo` and `MediaTrackCapabilities` * Regenerate WebIDL bindings * Add changelog entry for `InputDeviceInfo` and `MediaTrackCapabilities`
- Loading branch information
1 parent
73e5a8c
commit 7ad4c3f
Showing
9 changed files
with
489 additions
and
0 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
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,63 @@ | ||
#![allow(unused_imports)] | ||
#![allow(clippy::all)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = DoubleRange)] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `DoubleRange` dictionary."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] | ||
#[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 DoubleRange; | ||
#[wasm_bindgen(method, setter = "max")] | ||
fn max_shim(this: &DoubleRange, val: f64); | ||
#[wasm_bindgen(method, setter = "min")] | ||
fn min_shim(this: &DoubleRange, val: f64); | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
impl DoubleRange { | ||
#[doc = "Construct a new `DoubleRange`."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] | ||
#[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 `max` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] | ||
#[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 max(&mut self, val: f64) -> &mut Self { | ||
self.max_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `min` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] | ||
#[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 min(&mut self, val: f64) -> &mut Self { | ||
self.min_shim(val); | ||
self | ||
} | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
impl Default for DoubleRange { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} |
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,31 @@ | ||
#![allow(unused_imports)] | ||
#![allow(clippy::all)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = MediaDeviceInfo , extends = :: js_sys :: Object , js_name = InputDeviceInfo , typescript_type = "InputDeviceInfo")] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `InputDeviceInfo` class."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `InputDeviceInfo`*"] | ||
#[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 InputDeviceInfo; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "MediaTrackCapabilities")] | ||
# [wasm_bindgen (method , structural , js_class = "InputDeviceInfo" , js_name = getCapabilities)] | ||
#[doc = "The `getCapabilities()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo/getCapabilities)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `InputDeviceInfo`, `MediaTrackCapabilities`*"] | ||
#[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_capabilities(this: &InputDeviceInfo) -> MediaTrackCapabilities; | ||
} |
248 changes: 248 additions & 0 deletions
248
crates/web-sys/src/features/gen_MediaTrackCapabilities.rs
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,248 @@ | ||
#![allow(unused_imports)] | ||
#![allow(clippy::all)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaTrackCapabilities)] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `MediaTrackCapabilities` dictionary."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 MediaTrackCapabilities; | ||
#[cfg(feature = "DoubleRange")] | ||
#[wasm_bindgen(method, setter = "aspectRatio")] | ||
fn aspect_ratio_shim(this: &MediaTrackCapabilities, val: &DoubleRange); | ||
#[wasm_bindgen(method, setter = "autoGainControl")] | ||
fn auto_gain_control_shim(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); | ||
#[cfg(feature = "ULongRange")] | ||
#[wasm_bindgen(method, setter = "channelCount")] | ||
fn channel_count_shim(this: &MediaTrackCapabilities, val: &ULongRange); | ||
#[wasm_bindgen(method, setter = "deviceId")] | ||
fn device_id_shim(this: &MediaTrackCapabilities, val: &str); | ||
#[wasm_bindgen(method, setter = "echoCancellation")] | ||
fn echo_cancellation_shim(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); | ||
#[wasm_bindgen(method, setter = "facingMode")] | ||
fn facing_mode_shim(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); | ||
#[cfg(feature = "DoubleRange")] | ||
#[wasm_bindgen(method, setter = "frameRate")] | ||
fn frame_rate_shim(this: &MediaTrackCapabilities, val: &DoubleRange); | ||
#[wasm_bindgen(method, setter = "groupId")] | ||
fn group_id_shim(this: &MediaTrackCapabilities, val: &str); | ||
#[cfg(feature = "ULongRange")] | ||
#[wasm_bindgen(method, setter = "height")] | ||
fn height_shim(this: &MediaTrackCapabilities, val: &ULongRange); | ||
#[cfg(feature = "DoubleRange")] | ||
#[wasm_bindgen(method, setter = "latency")] | ||
fn latency_shim(this: &MediaTrackCapabilities, val: &DoubleRange); | ||
#[wasm_bindgen(method, setter = "noiseSuppression")] | ||
fn noise_suppression_shim(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); | ||
#[wasm_bindgen(method, setter = "resizeMode")] | ||
fn resize_mode_shim(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); | ||
#[cfg(feature = "ULongRange")] | ||
#[wasm_bindgen(method, setter = "sampleRate")] | ||
fn sample_rate_shim(this: &MediaTrackCapabilities, val: &ULongRange); | ||
#[cfg(feature = "ULongRange")] | ||
#[wasm_bindgen(method, setter = "sampleSize")] | ||
fn sample_size_shim(this: &MediaTrackCapabilities, val: &ULongRange); | ||
#[cfg(feature = "ULongRange")] | ||
#[wasm_bindgen(method, setter = "width")] | ||
fn width_shim(this: &MediaTrackCapabilities, val: &ULongRange); | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
impl MediaTrackCapabilities { | ||
#[doc = "Construct a new `MediaTrackCapabilities`."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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)] | ||
#[cfg(feature = "DoubleRange")] | ||
#[doc = "Change the `aspectRatio` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] | ||
#[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 aspect_ratio(&mut self, val: &DoubleRange) -> &mut Self { | ||
self.aspect_ratio_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `autoGainControl` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
self.auto_gain_control_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "ULongRange")] | ||
#[doc = "Change the `channelCount` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] | ||
#[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 channel_count(&mut self, val: &ULongRange) -> &mut Self { | ||
self.channel_count_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `deviceId` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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_id(&mut self, val: &str) -> &mut Self { | ||
self.device_id_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `echoCancellation` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
self.echo_cancellation_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `facingMode` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
self.facing_mode_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "DoubleRange")] | ||
#[doc = "Change the `frameRate` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] | ||
#[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 frame_rate(&mut self, val: &DoubleRange) -> &mut Self { | ||
self.frame_rate_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `groupId` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 group_id(&mut self, val: &str) -> &mut Self { | ||
self.group_id_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "ULongRange")] | ||
#[doc = "Change the `height` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] | ||
#[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 height(&mut self, val: &ULongRange) -> &mut Self { | ||
self.height_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "DoubleRange")] | ||
#[doc = "Change the `latency` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] | ||
#[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 latency(&mut self, val: &DoubleRange) -> &mut Self { | ||
self.latency_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `noiseSuppression` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
self.noise_suppression_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[doc = "Change the `resizeMode` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] | ||
#[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 resize_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | ||
self.resize_mode_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "ULongRange")] | ||
#[doc = "Change the `sampleRate` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] | ||
#[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 sample_rate(&mut self, val: &ULongRange) -> &mut Self { | ||
self.sample_rate_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "ULongRange")] | ||
#[doc = "Change the `sampleSize` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] | ||
#[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 sample_size(&mut self, val: &ULongRange) -> &mut Self { | ||
self.sample_size_shim(val); | ||
self | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "ULongRange")] | ||
#[doc = "Change the `width` field of this object."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] | ||
#[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 width(&mut self, val: &ULongRange) -> &mut Self { | ||
self.width_shim(val); | ||
self | ||
} | ||
} | ||
#[cfg(web_sys_unstable_apis)] | ||
impl Default for MediaTrackCapabilities { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} |
Oops, something went wrong.