diff --git a/CHANGELOG.md b/CHANGELOG.md index f010e99fb8f..763ab639546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ * Added JSDoc type annotations to C-style enums. [#4192](https://github.com/rustwasm/wasm-bindgen/pull/4192) +* Added bindings for `MediaStreamTrack.getCapabilities`. + [#4236](https://github.com/rustwasm/wasm-bindgen/pull/4236) + ### Changed * String enums now generate private TypeScript types but only if used. @@ -34,6 +37,9 @@ * Deprecate `--reference-types` in favor of automatic target feature detection. [#4237](https://github.com/rustwasm/wasm-bindgen/pull/4237) +* Stabilized `MediaTrackCapabilities`. + [#4236](https://github.com/rustwasm/wasm-bindgen/pull/4236) + ### Fixed * Fixed methods with `self: &Self` consuming the object. diff --git a/crates/web-sys/src/features/gen_DoubleRange.rs b/crates/web-sys/src/features/gen_DoubleRange.rs index 86a427e7df0..a11df7925af 100644 --- a/crates/web-sys/src/features/gen_DoubleRange.rs +++ b/crates/web-sys/src/features/gen_DoubleRange.rs @@ -2,7 +2,6 @@ #![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)] @@ -10,74 +9,48 @@ extern "C" { #[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; - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "max")] pub fn get_max(this: &DoubleRange) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "max")] pub fn set_max(this: &DoubleRange, val: f64); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "min")] pub fn get_min(this: &DoubleRange) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "min")] pub fn set_min(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)] #[deprecated = "Use `set_max()` instead."] pub fn max(&mut self, val: f64) -> &mut Self { self.set_max(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_min()` instead."] pub fn min(&mut self, val: f64) -> &mut Self { self.set_min(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for DoubleRange { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_MediaStreamTrack.rs b/crates/web-sys/src/features/gen_MediaStreamTrack.rs index 1e7007ffc23..c094823d817 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrack.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrack.rs @@ -129,6 +129,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"] pub fn clone(this: &MediaStreamTrack) -> MediaStreamTrack; + #[cfg(feature = "MediaTrackCapabilities")] + # [wasm_bindgen (method , structural , js_class = "MediaStreamTrack" , js_name = getCapabilities)] + #[doc = "The `getCapabilities()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaTrackCapabilities`*"] + pub fn get_capabilities(this: &MediaStreamTrack) -> MediaTrackCapabilities; #[cfg(feature = "MediaTrackConstraints")] # [wasm_bindgen (method , structural , js_class = "MediaStreamTrack" , js_name = getConstraints)] #[doc = "The `getConstraints()` method."] diff --git a/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs b/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs index 1c6d82c5cb9..990e25c18d6 100644 --- a/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs +++ b/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs @@ -2,7 +2,6 @@ #![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)] @@ -10,402 +9,275 @@ extern "C" { #[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(web_sys_unstable_apis)] #[cfg(feature = "DoubleRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "aspectRatio")] pub fn get_aspect_ratio(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "aspectRatio")] pub fn set_aspect_ratio(this: &MediaTrackCapabilities, val: &DoubleRange); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "autoGainControl")] pub fn get_auto_gain_control(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; - #[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)*"] #[wasm_bindgen(method, setter = "autoGainControl")] pub fn set_auto_gain_control(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); - #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `backgroundBlur` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[wasm_bindgen(method, getter = "backgroundBlur")] + pub fn get_background_blur(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[doc = "Change the `backgroundBlur` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[wasm_bindgen(method, setter = "backgroundBlur")] + pub fn set_background_blur(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); #[cfg(feature = "ULongRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "channelCount")] pub fn get_channel_count(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "channelCount")] pub fn set_channel_count(this: &MediaTrackCapabilities, val: &ULongRange); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "deviceId")] pub fn get_device_id(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "deviceId")] pub fn set_device_id(this: &MediaTrackCapabilities, val: &str); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "echoCancellation")] pub fn get_echo_cancellation(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; - #[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)*"] #[wasm_bindgen(method, setter = "echoCancellation")] pub fn set_echo_cancellation(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "facingMode")] pub fn get_facing_mode(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; - #[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)*"] #[wasm_bindgen(method, setter = "facingMode")] pub fn set_facing_mode(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DoubleRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "frameRate")] pub fn get_frame_rate(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "frameRate")] pub fn set_frame_rate(this: &MediaTrackCapabilities, val: &DoubleRange); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "groupId")] pub fn get_group_id(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "groupId")] pub fn set_group_id(this: &MediaTrackCapabilities, val: &str); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "height")] pub fn get_height(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "height")] pub fn set_height(this: &MediaTrackCapabilities, val: &ULongRange); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DoubleRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "latency")] pub fn get_latency(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "latency")] pub fn set_latency(this: &MediaTrackCapabilities, val: &DoubleRange); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "noiseSuppression")] pub fn get_noise_suppression(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; - #[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)*"] #[wasm_bindgen(method, setter = "noiseSuppression")] pub fn set_noise_suppression(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "resizeMode")] pub fn get_resize_mode(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; - #[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)*"] #[wasm_bindgen(method, setter = "resizeMode")] pub fn set_resize_mode(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "sampleRate")] pub fn get_sample_rate(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "sampleRate")] pub fn set_sample_rate(this: &MediaTrackCapabilities, val: &ULongRange); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "sampleSize")] pub fn get_sample_size(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "sampleSize")] pub fn set_sample_size(this: &MediaTrackCapabilities, val: &ULongRange); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "width")] pub fn get_width(this: &MediaTrackCapabilities) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "width")] pub fn set_width(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")] #[deprecated = "Use `set_aspect_ratio()` instead."] pub fn aspect_ratio(&mut self, val: &DoubleRange) -> &mut Self { self.set_aspect_ratio(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_auto_gain_control()` instead."] pub fn auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { self.set_auto_gain_control(val); self } - #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_background_blur()` instead."] + pub fn background_blur(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_background_blur(val); + self + } #[cfg(feature = "ULongRange")] #[deprecated = "Use `set_channel_count()` instead."] pub fn channel_count(&mut self, val: &ULongRange) -> &mut Self { self.set_channel_count(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_device_id()` instead."] pub fn device_id(&mut self, val: &str) -> &mut Self { self.set_device_id(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_echo_cancellation()` instead."] pub fn echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { self.set_echo_cancellation(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_facing_mode()` instead."] pub fn facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { self.set_facing_mode(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DoubleRange")] #[deprecated = "Use `set_frame_rate()` instead."] pub fn frame_rate(&mut self, val: &DoubleRange) -> &mut Self { self.set_frame_rate(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_group_id()` instead."] pub fn group_id(&mut self, val: &str) -> &mut Self { self.set_group_id(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: &ULongRange) -> &mut Self { self.set_height(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DoubleRange")] #[deprecated = "Use `set_latency()` instead."] pub fn latency(&mut self, val: &DoubleRange) -> &mut Self { self.set_latency(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_noise_suppression()` instead."] pub fn noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { self.set_noise_suppression(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_resize_mode()` instead."] pub fn resize_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { self.set_resize_mode(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[deprecated = "Use `set_sample_rate()` instead."] pub fn sample_rate(&mut self, val: &ULongRange) -> &mut Self { self.set_sample_rate(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[deprecated = "Use `set_sample_size()` instead."] pub fn sample_size(&mut self, val: &ULongRange) -> &mut Self { self.set_sample_size(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ULongRange")] #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: &ULongRange) -> &mut Self { @@ -413,7 +285,6 @@ impl MediaTrackCapabilities { self } } -#[cfg(web_sys_unstable_apis)] impl Default for MediaTrackCapabilities { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_ULongRange.rs b/crates/web-sys/src/features/gen_ULongRange.rs index acf295622ee..fc292a3f7de 100644 --- a/crates/web-sys/src/features/gen_ULongRange.rs +++ b/crates/web-sys/src/features/gen_ULongRange.rs @@ -2,7 +2,6 @@ #![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)] @@ -10,74 +9,48 @@ extern "C" { #[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; - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "max")] pub fn get_max(this: &ULongRange) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "max")] pub fn set_max(this: &ULongRange, val: u32); - #[cfg(web_sys_unstable_apis)] #[doc = "Get 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)*"] #[wasm_bindgen(method, getter = "min")] pub fn get_min(this: &ULongRange) -> Option; - #[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)*"] #[wasm_bindgen(method, setter = "min")] pub fn set_min(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)] #[deprecated = "Use `set_max()` instead."] pub fn max(&mut self, val: u32) -> &mut Self { self.set_max(val); self } - #[cfg(web_sys_unstable_apis)] #[deprecated = "Use `set_min()` instead."] pub fn min(&mut self, val: u32) -> &mut Self { self.set_min(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for ULongRange { fn default() -> Self { Self::new() diff --git a/crates/web-sys/webidls/enabled/MediaStreamTrack.webidl b/crates/web-sys/webidls/enabled/MediaStreamTrack.webidl index 896856a431d..734e6dd8e4c 100644 --- a/crates/web-sys/webidls/enabled/MediaStreamTrack.webidl +++ b/crates/web-sys/webidls/enabled/MediaStreamTrack.webidl @@ -83,7 +83,7 @@ interface MediaStreamTrack : EventTarget { attribute EventHandler onended; MediaStreamTrack clone (); undefined stop (); -// MediaTrackCapabilities getCapabilities (); + MediaTrackCapabilities getCapabilities (); MediaTrackConstraints getConstraints (); [NeedsCallerType] MediaTrackSettings getSettings (); diff --git a/crates/web-sys/webidls/unstable/MediaTrackCapabilities.webidl b/crates/web-sys/webidls/enabled/MediaTrackCapabilities.webidl similarity index 96% rename from crates/web-sys/webidls/unstable/MediaTrackCapabilities.webidl rename to crates/web-sys/webidls/enabled/MediaTrackCapabilities.webidl index ba6bd9c4607..6052b18d661 100644 --- a/crates/web-sys/webidls/unstable/MediaTrackCapabilities.webidl +++ b/crates/web-sys/webidls/enabled/MediaTrackCapabilities.webidl @@ -33,4 +33,5 @@ dictionary MediaTrackCapabilities { ULongRange channelCount; DOMString deviceId; DOMString groupId; + sequence backgroundBlur; };