web_sys/features/
gen_SpeechSynthesisErrorEventInit.rs

1#![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 = SpeechSynthesisErrorEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `SpeechSynthesisErrorEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"]
12    pub type SpeechSynthesisErrorEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`*"]
46    #[wasm_bindgen(method, getter = "charIndex")]
47    pub fn get_char_index(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
51    #[wasm_bindgen(method, setter = "charIndex")]
52    pub fn set_char_index(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`*"]
56    #[wasm_bindgen(method, getter = "charLength")]
57    pub fn get_char_length(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
61    #[wasm_bindgen(method, setter = "charLength")]
62    pub fn set_char_length(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`*"]
66    #[wasm_bindgen(method, getter = "elapsedTime")]
67    pub fn get_elapsed_time(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
71    #[wasm_bindgen(method, setter = "elapsedTime")]
72    pub fn set_elapsed_time(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`*"]
76    #[wasm_bindgen(method, getter = "name")]
77    pub fn get_name(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`*"]
81    #[wasm_bindgen(method, setter = "name")]
82    pub fn set_name(this: &SpeechSynthesisErrorEventInit, 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: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"]
87    #[wasm_bindgen(method, getter = "utterance")]
88    pub fn get_utterance(this: &SpeechSynthesisErrorEventInit) -> 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: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"]
93    #[wasm_bindgen(method, setter = "utterance")]
94    pub fn set_utterance(this: &SpeechSynthesisErrorEventInit, val: &SpeechSynthesisUtterance);
95    #[cfg(feature = "SpeechSynthesisErrorCode")]
96    #[doc = "Get the `error` field of this object."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"]
99    #[wasm_bindgen(method, getter = "error")]
100    pub fn get_error(this: &SpeechSynthesisErrorEventInit) -> SpeechSynthesisErrorCode;
101    #[cfg(feature = "SpeechSynthesisErrorCode")]
102    #[doc = "Change the `error` field of this object."]
103    #[doc = ""]
104    #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"]
105    #[wasm_bindgen(method, setter = "error")]
106    pub fn set_error(this: &SpeechSynthesisErrorEventInit, val: SpeechSynthesisErrorCode);
107}
108impl SpeechSynthesisErrorEventInit {
109    #[cfg(all(
110        feature = "SpeechSynthesisErrorCode",
111        feature = "SpeechSynthesisUtterance",
112    ))]
113    #[doc = "Construct a new `SpeechSynthesisErrorEventInit`."]
114    #[doc = ""]
115    #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"]
116    pub fn new(utterance: &SpeechSynthesisUtterance, error: SpeechSynthesisErrorCode) -> Self {
117        #[allow(unused_mut)]
118        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
119        ret.set_utterance(utterance);
120        ret.set_error(error);
121        ret
122    }
123    #[deprecated = "Use `set_bubbles()` instead."]
124    pub fn bubbles(&mut self, val: bool) -> &mut Self {
125        self.set_bubbles(val);
126        self
127    }
128    #[deprecated = "Use `set_cancelable()` instead."]
129    pub fn cancelable(&mut self, val: bool) -> &mut Self {
130        self.set_cancelable(val);
131        self
132    }
133    #[deprecated = "Use `set_composed()` instead."]
134    pub fn composed(&mut self, val: bool) -> &mut Self {
135        self.set_composed(val);
136        self
137    }
138    #[deprecated = "Use `set_char_index()` instead."]
139    pub fn char_index(&mut self, val: u32) -> &mut Self {
140        self.set_char_index(val);
141        self
142    }
143    #[deprecated = "Use `set_char_length()` instead."]
144    pub fn char_length(&mut self, val: Option<u32>) -> &mut Self {
145        self.set_char_length(val);
146        self
147    }
148    #[deprecated = "Use `set_elapsed_time()` instead."]
149    pub fn elapsed_time(&mut self, val: f32) -> &mut Self {
150        self.set_elapsed_time(val);
151        self
152    }
153    #[deprecated = "Use `set_name()` instead."]
154    pub fn name(&mut self, val: &str) -> &mut Self {
155        self.set_name(val);
156        self
157    }
158    #[cfg(feature = "SpeechSynthesisUtterance")]
159    #[deprecated = "Use `set_utterance()` instead."]
160    pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self {
161        self.set_utterance(val);
162        self
163    }
164    #[cfg(feature = "SpeechSynthesisErrorCode")]
165    #[deprecated = "Use `set_error()` instead."]
166    pub fn error(&mut self, val: SpeechSynthesisErrorCode) -> &mut Self {
167        self.set_error(val);
168        self
169    }
170}