Skip to main content

web_sys/features/
gen_AudioDecoder.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    #[wasm_bindgen(
9        extends = "EventTarget",
10        extends = "::js_sys::Object",
11        js_name = "AudioDecoder",
12        typescript_type = "AudioDecoder"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `AudioDecoder` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
20    #[doc = ""]
21    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
22    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
23    pub type AudioDecoder;
24    #[cfg(web_sys_unstable_apis)]
25    #[cfg(feature = "CodecState")]
26    #[wasm_bindgen(method, getter, js_class = "AudioDecoder", js_name = "state")]
27    #[doc = "Getter for the `state` field of this object."]
28    #[doc = ""]
29    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/state)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `CodecState`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    pub fn state(this: &AudioDecoder) -> CodecState;
36    #[cfg(web_sys_unstable_apis)]
37    #[wasm_bindgen(method, getter, js_class = "AudioDecoder", js_name = "decodeQueueSize")]
38    #[doc = "Getter for the `decodeQueueSize` field of this object."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/decodeQueueSize)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
43    #[doc = ""]
44    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
46    pub fn decode_queue_size(this: &AudioDecoder) -> u32;
47    #[cfg(web_sys_unstable_apis)]
48    #[wasm_bindgen(method, getter, js_class = "AudioDecoder", js_name = "ondequeue")]
49    #[doc = "Getter for the `ondequeue` field of this object."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/ondequeue)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
54    #[doc = ""]
55    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
57    pub fn ondequeue(this: &AudioDecoder) -> Option<::js_sys::Function>;
58    #[cfg(web_sys_unstable_apis)]
59    #[wasm_bindgen(method, setter, js_class = "AudioDecoder", js_name = "ondequeue")]
60    #[doc = "Setter for the `ondequeue` field of this object."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/ondequeue)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
65    #[doc = ""]
66    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
67    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
68    pub fn set_ondequeue(this: &AudioDecoder, value: Option<&::js_sys::Function>);
69    #[cfg(web_sys_unstable_apis)]
70    #[cfg(feature = "AudioDecoderInit")]
71    #[wasm_bindgen(catch, constructor, js_class = "AudioDecoder")]
72    #[doc = "The `new AudioDecoder(..)` constructor, creating a new instance of `AudioDecoder`."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/AudioDecoder)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `AudioDecoderInit`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    pub fn new(init: &AudioDecoderInit) -> Result<AudioDecoder, JsValue>;
81    #[cfg(web_sys_unstable_apis)]
82    #[wasm_bindgen(catch, method, js_class = "AudioDecoder")]
83    #[doc = "The `close()` method."]
84    #[doc = ""]
85    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/close)"]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
88    #[doc = ""]
89    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
91    pub fn close(this: &AudioDecoder) -> Result<(), JsValue>;
92    #[cfg(web_sys_unstable_apis)]
93    #[cfg(feature = "AudioDecoderConfig")]
94    #[wasm_bindgen(catch, method, js_class = "AudioDecoder")]
95    #[doc = "The `configure()` method."]
96    #[doc = ""]
97    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/configure)"]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `AudioDecoderConfig`*"]
100    #[doc = ""]
101    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
103    pub fn configure(this: &AudioDecoder, config: &AudioDecoderConfig) -> Result<(), JsValue>;
104    #[cfg(web_sys_unstable_apis)]
105    #[cfg(feature = "EncodedAudioChunk")]
106    #[wasm_bindgen(catch, method, js_class = "AudioDecoder")]
107    #[doc = "The `decode()` method."]
108    #[doc = ""]
109    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/decode)"]
110    #[doc = ""]
111    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `EncodedAudioChunk`*"]
112    #[doc = ""]
113    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
114    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
115    pub fn decode(this: &AudioDecoder, chunk: &EncodedAudioChunk) -> Result<(), JsValue>;
116    #[cfg(web_sys_unstable_apis)]
117    #[wasm_bindgen(method, js_class = "AudioDecoder")]
118    #[doc = "The `flush()` method."]
119    #[doc = ""]
120    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/flush)"]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
123    #[doc = ""]
124    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
125    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
126    pub fn flush(this: &AudioDecoder) -> ::js_sys::Promise<::js_sys::Undefined>;
127    #[cfg(web_sys_unstable_apis)]
128    #[cfg(all(feature = "AudioDecoderConfig", feature = "AudioDecoderSupport",))]
129    #[wasm_bindgen(
130        static_method_of = "AudioDecoder",
131        js_class = "AudioDecoder",
132        js_name = "isConfigSupported"
133    )]
134    #[doc = "The `isConfigSupported()` method."]
135    #[doc = ""]
136    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/isConfigSupported_static)"]
137    #[doc = ""]
138    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `AudioDecoderConfig`, `AudioDecoderSupport`*"]
139    #[doc = ""]
140    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
141    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
142    pub fn is_config_supported(
143        config: &AudioDecoderConfig,
144    ) -> ::js_sys::Promise<AudioDecoderSupport>;
145    #[cfg(web_sys_unstable_apis)]
146    #[wasm_bindgen(catch, method, js_class = "AudioDecoder")]
147    #[doc = "The `reset()` method."]
148    #[doc = ""]
149    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/reset)"]
150    #[doc = ""]
151    #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`*"]
152    #[doc = ""]
153    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
154    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
155    pub fn reset(this: &AudioDecoder) -> Result<(), JsValue>;
156}