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