mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-30 12:33:54 +03:00
Add WebIDL definitions for InputDeviceInfo
and MediaTrackCapabilities
(#3935)
* Add WebIDL definitions for `InputDeviceInfo` and `MediaTrackCapabilities` * Regenerate WebIDL bindings * Add changelog entry for `InputDeviceInfo` and `MediaTrackCapabilities`
This commit is contained in:
parent
73e5a8c482
commit
7ad4c3f931
@ -17,6 +17,9 @@
|
||||
* Added support for returning `Vec`s from async functions.
|
||||
[#3630](https://github.com/rustwasm/wasm-bindgen/pull/3630)
|
||||
|
||||
* Added bindings for `InputDeviceInfo` and `MediaTrackCapabilities`.
|
||||
[#3935](https://github.com/rustwasm/wasm-bindgen/pull/3935)
|
||||
|
||||
### Changed
|
||||
|
||||
* Stabilize Web Share API.
|
||||
|
@ -326,6 +326,7 @@ DomStringList = []
|
||||
DomStringMap = []
|
||||
DomTokenList = []
|
||||
DomWindowResizeEventDetail = []
|
||||
DoubleRange = []
|
||||
DragEvent = ["Event", "MouseEvent", "UiEvent"]
|
||||
DragEventInit = []
|
||||
DynamicsCompressorNode = ["AudioNode", "EventTarget"]
|
||||
@ -728,6 +729,7 @@ ImageEncodeOptions = []
|
||||
ImageOrientation = []
|
||||
ImageTrack = ["EventTarget"]
|
||||
ImageTrackList = []
|
||||
InputDeviceInfo = ["MediaDeviceInfo"]
|
||||
InputEvent = ["Event", "UiEvent"]
|
||||
InputEventInit = []
|
||||
IntersectionObserver = []
|
||||
@ -829,6 +831,7 @@ MediaStreamTrackGeneratorInit = []
|
||||
MediaStreamTrackProcessor = []
|
||||
MediaStreamTrackProcessorInit = []
|
||||
MediaStreamTrackState = []
|
||||
MediaTrackCapabilities = []
|
||||
MediaTrackConstraintSet = []
|
||||
MediaTrackConstraints = []
|
||||
MediaTrackSettings = []
|
||||
@ -1405,6 +1408,7 @@ TreeView = []
|
||||
TreeWalker = []
|
||||
U2f = []
|
||||
U2fClientData = []
|
||||
ULongRange = []
|
||||
UdpMessageEventInit = []
|
||||
UdpOptions = []
|
||||
UiEvent = ["Event"]
|
||||
|
63
crates/web-sys/src/features/gen_DoubleRange.rs
Normal file
63
crates/web-sys/src/features/gen_DoubleRange.rs
Normal file
@ -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()
|
||||
}
|
||||
}
|
31
crates/web-sys/src/features/gen_InputDeviceInfo.rs
Normal file
31
crates/web-sys/src/features/gen_InputDeviceInfo.rs
Normal file
@ -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
crates/web-sys/src/features/gen_MediaTrackCapabilities.rs
Normal file
248
crates/web-sys/src/features/gen_MediaTrackCapabilities.rs
Normal file
@ -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()
|
||||
}
|
||||
}
|
63
crates/web-sys/src/features/gen_ULongRange.rs
Normal file
63
crates/web-sys/src/features/gen_ULongRange.rs
Normal file
@ -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 = ULongRange)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[doc = "The `ULongRange` dictionary."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `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 type ULongRange;
|
||||
#[wasm_bindgen(method, setter = "max")]
|
||||
fn max_shim(this: &ULongRange, val: u32);
|
||||
#[wasm_bindgen(method, setter = "min")]
|
||||
fn min_shim(this: &ULongRange, val: u32);
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
impl ULongRange {
|
||||
#[doc = "Construct a new `ULongRange`."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `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 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: `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 max(&mut self, val: u32) -> &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: `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 min(&mut self, val: u32) -> &mut Self {
|
||||
self.min_shim(val);
|
||||
self
|
||||
}
|
||||
}
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
impl Default for ULongRange {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
@ -2063,6 +2063,13 @@ mod gen_DomWindowResizeEventDetail;
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_DomWindowResizeEventDetail::*;
|
||||
|
||||
#[cfg(feature = "DoubleRange")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_DoubleRange;
|
||||
#[cfg(feature = "DoubleRange")]
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_DoubleRange::*;
|
||||
|
||||
#[cfg(feature = "DragEvent")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_DragEvent;
|
||||
@ -4877,6 +4884,13 @@ mod gen_ImageTrackList;
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_ImageTrackList::*;
|
||||
|
||||
#[cfg(feature = "InputDeviceInfo")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_InputDeviceInfo;
|
||||
#[cfg(feature = "InputDeviceInfo")]
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_InputDeviceInfo::*;
|
||||
|
||||
#[cfg(feature = "InputEvent")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_InputEvent;
|
||||
@ -5584,6 +5598,13 @@ mod gen_MediaStreamTrackState;
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_MediaStreamTrackState::*;
|
||||
|
||||
#[cfg(feature = "MediaTrackCapabilities")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_MediaTrackCapabilities;
|
||||
#[cfg(feature = "MediaTrackCapabilities")]
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_MediaTrackCapabilities::*;
|
||||
|
||||
#[cfg(feature = "MediaTrackConstraintSet")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_MediaTrackConstraintSet;
|
||||
@ -9616,6 +9637,13 @@ mod gen_U2fClientData;
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_U2fClientData::*;
|
||||
|
||||
#[cfg(feature = "ULongRange")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_ULongRange;
|
||||
#[cfg(feature = "ULongRange")]
|
||||
#[allow(unused_imports)]
|
||||
pub use gen_ULongRange::*;
|
||||
|
||||
#[cfg(feature = "UdpMessageEventInit")]
|
||||
#[allow(non_snake_case)]
|
||||
mod gen_UdpMessageEventInit;
|
||||
|
13
crates/web-sys/webidls/unstable/InputDeviceInfo.webidl
vendored
Normal file
13
crates/web-sys/webidls/unstable/InputDeviceInfo.webidl
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://w3c.github.io/mediacapture-main/#dom-inputdeviceinfo
|
||||
*/
|
||||
|
||||
[Exposed=Window, SecureContext]
|
||||
interface InputDeviceInfo : MediaDeviceInfo {
|
||||
MediaTrackCapabilities getCapabilities();
|
||||
};
|
36
crates/web-sys/webidls/unstable/MediaTrackCapabilities.webidl
vendored
Normal file
36
crates/web-sys/webidls/unstable/MediaTrackCapabilities.webidl
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://w3c.github.io/mediacapture-main/#dom-mediatrackcapabilities
|
||||
*/
|
||||
|
||||
dictionary ULongRange {
|
||||
[Clamp] unsigned long max;
|
||||
[Clamp] unsigned long min;
|
||||
};
|
||||
|
||||
dictionary DoubleRange {
|
||||
double max;
|
||||
double min;
|
||||
};
|
||||
|
||||
dictionary MediaTrackCapabilities {
|
||||
ULongRange width;
|
||||
ULongRange height;
|
||||
DoubleRange aspectRatio;
|
||||
DoubleRange frameRate;
|
||||
sequence<DOMString> facingMode;
|
||||
sequence<DOMString> resizeMode;
|
||||
ULongRange sampleRate;
|
||||
ULongRange sampleSize;
|
||||
sequence<boolean> echoCancellation;
|
||||
sequence<boolean> autoGainControl;
|
||||
sequence<boolean> noiseSuppression;
|
||||
DoubleRange latency;
|
||||
ULongRange channelCount;
|
||||
DOMString deviceId;
|
||||
DOMString groupId;
|
||||
};
|
Loading…
Reference in New Issue
Block a user