Skip to main content

web_sys/features/
gen_AudioWorkletNode.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "AudioNode",
9        extends = "EventTarget",
10        extends = "::js_sys::Object",
11        js_name = "AudioWorkletNode",
12        typescript_type = "AudioWorkletNode"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `AudioWorkletNode` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`*"]
20    pub type AudioWorkletNode;
21    #[cfg(feature = "AudioParamMap")]
22    #[wasm_bindgen(
23        catch,
24        method,
25        getter,
26        js_class = "AudioWorkletNode",
27        js_name = "parameters"
28    )]
29    #[doc = "Getter for the `parameters` field of this object."]
30    #[doc = ""]
31    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/parameters)"]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`, `AudioWorkletNode`*"]
34    pub fn parameters(this: &AudioWorkletNode) -> Result<AudioParamMap, JsValue>;
35    #[cfg(feature = "MessagePort")]
36    #[wasm_bindgen(catch, method, getter, js_class = "AudioWorkletNode", js_name = "port")]
37    #[doc = "Getter for the `port` field of this object."]
38    #[doc = ""]
39    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/port)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`, `MessagePort`*"]
42    pub fn port(this: &AudioWorkletNode) -> Result<MessagePort, JsValue>;
43    #[wasm_bindgen(
44        method,
45        getter,
46        js_class = "AudioWorkletNode",
47        js_name = "onprocessorerror"
48    )]
49    #[doc = "Getter for the `onprocessorerror` field of this object."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/onprocessorerror)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`*"]
54    pub fn onprocessorerror(this: &AudioWorkletNode) -> Option<::js_sys::Function>;
55    #[wasm_bindgen(
56        method,
57        setter,
58        js_class = "AudioWorkletNode",
59        js_name = "onprocessorerror"
60    )]
61    #[doc = "Setter for the `onprocessorerror` field of this object."]
62    #[doc = ""]
63    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/onprocessorerror)"]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`*"]
66    pub fn set_onprocessorerror(this: &AudioWorkletNode, value: Option<&::js_sys::Function>);
67    #[cfg(feature = "BaseAudioContext")]
68    #[wasm_bindgen(catch, constructor, js_class = "AudioWorkletNode")]
69    #[doc = "The `new AudioWorkletNode(..)` constructor, creating a new instance of `AudioWorkletNode`."]
70    #[doc = ""]
71    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/AudioWorkletNode)"]
72    #[doc = ""]
73    #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`, `BaseAudioContext`*"]
74    pub fn new(context: &BaseAudioContext, name: &str) -> Result<AudioWorkletNode, JsValue>;
75    #[cfg(all(feature = "AudioWorkletNodeOptions", feature = "BaseAudioContext",))]
76    #[wasm_bindgen(catch, constructor, js_class = "AudioWorkletNode")]
77    #[doc = "The `new AudioWorkletNode(..)` constructor, creating a new instance of `AudioWorkletNode`."]
78    #[doc = ""]
79    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/AudioWorkletNode)"]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`, `AudioWorkletNodeOptions`, `BaseAudioContext`*"]
82    pub fn new_with_options(
83        context: &BaseAudioContext,
84        name: &str,
85        options: &AudioWorkletNodeOptions,
86    ) -> Result<AudioWorkletNode, JsValue>;
87}