web_sys/features/
gen_GainNode.rs1#![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 = "GainNode",
12 typescript_type = "GainNode"
13 )]
14 #[derive(Debug, Clone, PartialEq, Eq)]
15 #[doc = "The `GainNode` class."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GainNode)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `GainNode`*"]
20 pub type GainNode;
21 #[cfg(feature = "AudioParam")]
22 #[wasm_bindgen(method, getter, js_class = "GainNode", js_name = "gain")]
23 #[doc = "Getter for the `gain` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GainNode/gain)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `GainNode`*"]
28 pub fn gain(this: &GainNode) -> AudioParam;
29 #[cfg(feature = "BaseAudioContext")]
30 #[wasm_bindgen(catch, constructor, js_class = "GainNode")]
31 #[doc = "The `new GainNode(..)` constructor, creating a new instance of `GainNode`."]
32 #[doc = ""]
33 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GainNode/GainNode)"]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `GainNode`*"]
36 pub fn new(context: &BaseAudioContext) -> Result<GainNode, JsValue>;
37 #[cfg(all(feature = "BaseAudioContext", feature = "GainOptions",))]
38 #[wasm_bindgen(catch, constructor, js_class = "GainNode")]
39 #[doc = "The `new GainNode(..)` constructor, creating a new instance of `GainNode`."]
40 #[doc = ""]
41 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GainNode/GainNode)"]
42 #[doc = ""]
43 #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `GainNode`, `GainOptions`*"]
44 pub fn new_with_options(
45 context: &BaseAudioContext,
46 options: &GainOptions,
47 ) -> Result<GainNode, JsValue>;
48}