Skip to content

Commit

Permalink
run web-sys compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbarker committed Jun 12, 2023
1 parent ff4428f commit c447249
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 3 deletions.
4 changes: 4 additions & 0 deletions crates/web-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ AudioBufferSourceNode = ["AudioNode", "AudioScheduledSourceNode", "EventTarget"]
AudioBufferSourceOptions = []
AudioConfiguration = []
AudioContext = ["BaseAudioContext", "EventTarget"]
AudioContextLatencyCategory = []
AudioContextOptions = []
AudioContextState = []
AudioData = []
Expand All @@ -89,6 +90,9 @@ AudioParamMap = []
AudioProcessingEvent = ["Event"]
AudioSampleFormat = []
AudioScheduledSourceNode = ["AudioNode", "EventTarget"]
AudioSinkInfo = []
AudioSinkOptions = []
AudioSinkType = []
AudioStreamTrack = ["EventTarget", "MediaStreamTrack"]
AudioTrack = []
AudioTrackList = ["EventTarget"]
Expand Down
43 changes: 40 additions & 3 deletions crates/web-sys/src/features/gen_AudioContext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,29 @@ extern "C" {
#[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 sink_id(this: &AudioContext) -> String;
pub fn sink_id(this: &AudioContext) -> ::wasm_bindgen::JsValue;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , getter , js_class = "AudioContext" , js_name = onsinkchange)]
#[doc = "Getter for the `onsinkchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onsinkchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
#[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 onsinkchange(this: &AudioContext) -> Option<::js_sys::Function>;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , setter , js_class = "AudioContext" , js_name = onsinkchange)]
#[doc = "Setter for the `onsinkchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onsinkchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
#[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_onsinkchange(this: &AudioContext, value: Option<&::js_sys::Function>);
#[cfg(feature = "AudioDestinationNode")]
# [wasm_bindgen (structural , method , getter , js_class = "AudioContext" , js_name = destination)]
#[doc = "Getter for the `destination` field of this object."]
Expand Down Expand Up @@ -139,7 +161,7 @@ extern "C" {
media_stream: &MediaStream,
) -> Result<MediaStreamAudioSourceNode, JsValue>;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (catch , method , structural , js_class = "AudioContext" , js_name = setSinkId)]
# [wasm_bindgen (method , structural , js_class = "AudioContext" , js_name = setSinkId)]
#[doc = "The `setSinkId()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId)"]
Expand All @@ -148,7 +170,22 @@ extern "C" {
#[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_sink_id(this: &AudioContext, sink_id: &str) -> Result<::js_sys::Promise, JsValue>;
pub fn set_sink_id_with_str(this: &AudioContext, sink_id: &str) -> ::js_sys::Promise;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioSinkOptions")]
# [wasm_bindgen (method , structural , js_class = "AudioContext" , js_name = setSinkId)]
#[doc = "The `setSinkId()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioSinkOptions`*"]
#[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_sink_id_with_audio_sink_options(
this: &AudioContext,
sink_id: &AudioSinkOptions,
) -> ::js_sys::Promise;
# [wasm_bindgen (catch , method , structural , js_class = "AudioContext" , js_name = suspend)]
#[doc = "The `suspend()` method."]
#[doc = ""]
Expand Down
12 changes: 12 additions & 0 deletions crates/web-sys/src/features/gen_AudioContextLatencyCategory.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AudioContextLatencyCategory` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextLatencyCategory`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AudioContextLatencyCategory {
Balanced = "balanced",
Interactive = "interactive",
Playback = "playback",
}
35 changes: 35 additions & 0 deletions crates/web-sys/src/features/gen_AudioContextOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ impl AudioContextOptions {
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `latencyHint` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"]
pub fn latency_hint(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("latencyHint"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"]
Expand All @@ -36,6 +53,24 @@ impl AudioContextOptions {
let _ = r;
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `sinkId` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"]
#[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 sink_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sinkId"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}
impl Default for AudioContextOptions {
fn default() -> Self {
Expand Down
30 changes: 30 additions & 0 deletions crates/web-sys/src/features/gen_AudioSinkInfo.rs
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 = :: js_sys :: Object , js_name = AudioSinkInfo , typescript_type = "AudioSinkInfo")]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioSinkInfo` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioSinkInfo)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioSinkInfo`*"]
#[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 AudioSinkInfo;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioSinkType")]
# [wasm_bindgen (structural , method , getter , js_class = "AudioSinkInfo" , js_name = type)]
#[doc = "Getter for the `type` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioSinkInfo/type)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioSinkInfo`, `AudioSinkType`*"]
#[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_(this: &AudioSinkInfo) -> AudioSinkType;
}
50 changes: 50 additions & 0 deletions crates/web-sys/src/features/gen_AudioSinkOptions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#![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 = AudioSinkOptions)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioSinkOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`*"]
#[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 AudioSinkOptions;
}
#[cfg(web_sys_unstable_apis)]
impl AudioSinkOptions {
#[cfg(feature = "AudioSinkType")]
#[doc = "Construct a new `AudioSinkOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`, `AudioSinkType`*"]
#[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(type_: AudioSinkType) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.type_(type_);
ret
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioSinkType")]
#[doc = "Change the `type` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`, `AudioSinkType`*"]
#[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: AudioSinkType) -> &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
}
}
14 changes: 14 additions & 0 deletions crates/web-sys/src/features/gen_AudioSinkType.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
#[doc = "The `AudioSinkType` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioSinkType`*"]
#[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)*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AudioSinkType {
None = "none",
}
24 changes: 24 additions & 0 deletions crates/web-sys/src/features/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ mod gen_AudioContext;
#[cfg(feature = "AudioContext")]
pub use gen_AudioContext::*;

#[cfg(feature = "AudioContextLatencyCategory")]
#[allow(non_snake_case)]
mod gen_AudioContextLatencyCategory;
#[cfg(feature = "AudioContextLatencyCategory")]
pub use gen_AudioContextLatencyCategory::*;

#[cfg(feature = "AudioContextOptions")]
#[allow(non_snake_case)]
mod gen_AudioContextOptions;
Expand Down Expand Up @@ -352,6 +358,24 @@ mod gen_AudioScheduledSourceNode;
#[cfg(feature = "AudioScheduledSourceNode")]
pub use gen_AudioScheduledSourceNode::*;

#[cfg(feature = "AudioSinkInfo")]
#[allow(non_snake_case)]
mod gen_AudioSinkInfo;
#[cfg(feature = "AudioSinkInfo")]
pub use gen_AudioSinkInfo::*;

#[cfg(feature = "AudioSinkOptions")]
#[allow(non_snake_case)]
mod gen_AudioSinkOptions;
#[cfg(feature = "AudioSinkOptions")]
pub use gen_AudioSinkOptions::*;

#[cfg(feature = "AudioSinkType")]
#[allow(non_snake_case)]
mod gen_AudioSinkType;
#[cfg(feature = "AudioSinkType")]
pub use gen_AudioSinkType::*;

#[cfg(feature = "AudioStreamTrack")]
#[allow(non_snake_case)]
mod gen_AudioStreamTrack;
Expand Down

0 comments on commit c447249

Please sign in to comment.