web_sys/features/
gen_SpeechSynthesisEventInit.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SpeechSynthesisEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `SpeechSynthesisEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
12 pub type SpeechSynthesisEventInit;
13 #[doc = "Get the `bubbles` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
16 #[wasm_bindgen(method, getter = "bubbles")]
17 pub fn get_bubbles(this: &SpeechSynthesisEventInit) -> Option<bool>;
18 #[doc = "Change the `bubbles` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
21 #[wasm_bindgen(method, setter = "bubbles")]
22 pub fn set_bubbles(this: &SpeechSynthesisEventInit, val: bool);
23 #[doc = "Get the `cancelable` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
26 #[wasm_bindgen(method, getter = "cancelable")]
27 pub fn get_cancelable(this: &SpeechSynthesisEventInit) -> Option<bool>;
28 #[doc = "Change the `cancelable` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
31 #[wasm_bindgen(method, setter = "cancelable")]
32 pub fn set_cancelable(this: &SpeechSynthesisEventInit, val: bool);
33 #[doc = "Get the `composed` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
36 #[wasm_bindgen(method, getter = "composed")]
37 pub fn get_composed(this: &SpeechSynthesisEventInit) -> Option<bool>;
38 #[doc = "Change the `composed` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
41 #[wasm_bindgen(method, setter = "composed")]
42 pub fn set_composed(this: &SpeechSynthesisEventInit, val: bool);
43 #[doc = "Get the `charIndex` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
46 #[wasm_bindgen(method, getter = "charIndex")]
47 pub fn get_char_index(this: &SpeechSynthesisEventInit) -> Option<u32>;
48 #[doc = "Change the `charIndex` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
51 #[wasm_bindgen(method, setter = "charIndex")]
52 pub fn set_char_index(this: &SpeechSynthesisEventInit, val: u32);
53 #[doc = "Get the `charLength` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
56 #[wasm_bindgen(method, getter = "charLength")]
57 pub fn get_char_length(this: &SpeechSynthesisEventInit) -> Option<u32>;
58 #[doc = "Change the `charLength` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
61 #[wasm_bindgen(method, setter = "charLength")]
62 pub fn set_char_length(this: &SpeechSynthesisEventInit, val: Option<u32>);
63 #[doc = "Get the `elapsedTime` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
66 #[wasm_bindgen(method, getter = "elapsedTime")]
67 pub fn get_elapsed_time(this: &SpeechSynthesisEventInit) -> Option<f32>;
68 #[doc = "Change the `elapsedTime` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
71 #[wasm_bindgen(method, setter = "elapsedTime")]
72 pub fn set_elapsed_time(this: &SpeechSynthesisEventInit, val: f32);
73 #[doc = "Get the `name` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
76 #[wasm_bindgen(method, getter = "name")]
77 pub fn get_name(this: &SpeechSynthesisEventInit) -> Option<::alloc::string::String>;
78 #[doc = "Change the `name` field of this object."]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"]
81 #[wasm_bindgen(method, setter = "name")]
82 pub fn set_name(this: &SpeechSynthesisEventInit, val: &str);
83 #[cfg(feature = "SpeechSynthesisUtterance")]
84 #[doc = "Get the `utterance` field of this object."]
85 #[doc = ""]
86 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"]
87 #[wasm_bindgen(method, getter = "utterance")]
88 pub fn get_utterance(this: &SpeechSynthesisEventInit) -> SpeechSynthesisUtterance;
89 #[cfg(feature = "SpeechSynthesisUtterance")]
90 #[doc = "Change the `utterance` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"]
93 #[wasm_bindgen(method, setter = "utterance")]
94 pub fn set_utterance(this: &SpeechSynthesisEventInit, val: &SpeechSynthesisUtterance);
95}
96impl SpeechSynthesisEventInit {
97 #[cfg(feature = "SpeechSynthesisUtterance")]
98 #[doc = "Construct a new `SpeechSynthesisEventInit`."]
99 #[doc = ""]
100 #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"]
101 pub fn new(utterance: &SpeechSynthesisUtterance) -> Self {
102 #[allow(unused_mut)]
103 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
104 ret.set_utterance(utterance);
105 ret
106 }
107 #[deprecated = "Use `set_bubbles()` instead."]
108 pub fn bubbles(&mut self, val: bool) -> &mut Self {
109 self.set_bubbles(val);
110 self
111 }
112 #[deprecated = "Use `set_cancelable()` instead."]
113 pub fn cancelable(&mut self, val: bool) -> &mut Self {
114 self.set_cancelable(val);
115 self
116 }
117 #[deprecated = "Use `set_composed()` instead."]
118 pub fn composed(&mut self, val: bool) -> &mut Self {
119 self.set_composed(val);
120 self
121 }
122 #[deprecated = "Use `set_char_index()` instead."]
123 pub fn char_index(&mut self, val: u32) -> &mut Self {
124 self.set_char_index(val);
125 self
126 }
127 #[deprecated = "Use `set_char_length()` instead."]
128 pub fn char_length(&mut self, val: Option<u32>) -> &mut Self {
129 self.set_char_length(val);
130 self
131 }
132 #[deprecated = "Use `set_elapsed_time()` instead."]
133 pub fn elapsed_time(&mut self, val: f32) -> &mut Self {
134 self.set_elapsed_time(val);
135 self
136 }
137 #[deprecated = "Use `set_name()` instead."]
138 pub fn name(&mut self, val: &str) -> &mut Self {
139 self.set_name(val);
140 self
141 }
142 #[cfg(feature = "SpeechSynthesisUtterance")]
143 #[deprecated = "Use `set_utterance()` instead."]
144 pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self {
145 self.set_utterance(val);
146 self
147 }
148}