web_sys/features/
gen_OscillatorNode.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = AudioScheduledSourceNode , extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = OscillatorNode , typescript_type = "OscillatorNode")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `OscillatorNode` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
14 pub type OscillatorNode;
15 #[cfg(feature = "OscillatorType")]
16 # [wasm_bindgen (structural , method , getter , js_class = "OscillatorNode" , js_name = type)]
17 #[doc = "Getter for the `type` field of this object."]
18 #[doc = ""]
19 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/type)"]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`, `OscillatorType`*"]
22 pub fn type_(this: &OscillatorNode) -> OscillatorType;
23 #[cfg(feature = "OscillatorType")]
24 # [wasm_bindgen (structural , method , setter , js_class = "OscillatorNode" , js_name = type)]
25 #[doc = "Setter for the `type` field of this object."]
26 #[doc = ""]
27 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/type)"]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`, `OscillatorType`*"]
30 pub fn set_type(this: &OscillatorNode, value: OscillatorType);
31 #[cfg(feature = "AudioParam")]
32 # [wasm_bindgen (structural , method , getter , js_class = "OscillatorNode" , js_name = frequency)]
33 #[doc = "Getter for the `frequency` field of this object."]
34 #[doc = ""]
35 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/frequency)"]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `OscillatorNode`*"]
38 pub fn frequency(this: &OscillatorNode) -> AudioParam;
39 #[cfg(feature = "AudioParam")]
40 # [wasm_bindgen (structural , method , getter , js_class = "OscillatorNode" , js_name = detune)]
41 #[doc = "Getter for the `detune` field of this object."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/detune)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `OscillatorNode`*"]
46 pub fn detune(this: &OscillatorNode) -> AudioParam;
47 # [wasm_bindgen (structural , method , getter , js_class = "OscillatorNode" , js_name = onended)]
48 #[doc = "Getter for the `onended` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/onended)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
53 pub fn onended(this: &OscillatorNode) -> Option<::js_sys::Function>;
54 # [wasm_bindgen (structural , method , setter , js_class = "OscillatorNode" , js_name = onended)]
55 #[doc = "Setter for the `onended` field of this object."]
56 #[doc = ""]
57 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/onended)"]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
60 pub fn set_onended(this: &OscillatorNode, value: Option<&::js_sys::Function>);
61 #[cfg(feature = "BaseAudioContext")]
62 #[wasm_bindgen(catch, constructor, js_class = "OscillatorNode")]
63 #[doc = "The `new OscillatorNode(..)` constructor, creating a new instance of `OscillatorNode`."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/OscillatorNode)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `OscillatorNode`*"]
68 pub fn new(context: &BaseAudioContext) -> Result<OscillatorNode, JsValue>;
69 #[cfg(all(feature = "BaseAudioContext", feature = "OscillatorOptions",))]
70 #[wasm_bindgen(catch, constructor, js_class = "OscillatorNode")]
71 #[doc = "The `new OscillatorNode(..)` constructor, creating a new instance of `OscillatorNode`."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/OscillatorNode)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `OscillatorNode`, `OscillatorOptions`*"]
76 pub fn new_with_options(
77 context: &BaseAudioContext,
78 options: &OscillatorOptions,
79 ) -> Result<OscillatorNode, JsValue>;
80 #[cfg(feature = "PeriodicWave")]
81 # [wasm_bindgen (method , structural , js_class = "OscillatorNode" , js_name = setPeriodicWave)]
82 #[doc = "The `setPeriodicWave()` method."]
83 #[doc = ""]
84 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/setPeriodicWave)"]
85 #[doc = ""]
86 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`, `PeriodicWave`*"]
87 pub fn set_periodic_wave(this: &OscillatorNode, periodic_wave: &PeriodicWave);
88 # [wasm_bindgen (catch , method , structural , js_class = "OscillatorNode" , js_name = start)]
89 #[doc = "The `start()` method."]
90 #[doc = ""]
91 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/start)"]
92 #[doc = ""]
93 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
94 pub fn start(this: &OscillatorNode) -> Result<(), JsValue>;
95 # [wasm_bindgen (catch , method , structural , js_class = "OscillatorNode" , js_name = start)]
96 #[doc = "The `start()` method."]
97 #[doc = ""]
98 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/start)"]
99 #[doc = ""]
100 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
101 pub fn start_with_when(this: &OscillatorNode, when: f64) -> Result<(), JsValue>;
102 # [wasm_bindgen (catch , method , structural , js_class = "OscillatorNode" , js_name = stop)]
103 #[doc = "The `stop()` method."]
104 #[doc = ""]
105 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/stop)"]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
108 pub fn stop(this: &OscillatorNode) -> Result<(), JsValue>;
109 # [wasm_bindgen (catch , method , structural , js_class = "OscillatorNode" , js_name = stop)]
110 #[doc = "The `stop()` method."]
111 #[doc = ""]
112 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/stop)"]
113 #[doc = ""]
114 #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
115 pub fn stop_with_when(this: &OscillatorNode, when: f64) -> Result<(), JsValue>;
116}