]>
Commit | Line | Data |
---|---|---|
49aad941 | 1 | #![allow(unused_imports)] |
fe692bf9 | 2 | #![allow(clippy::all)] |
49aad941 FG |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; | |
5 | #[wasm_bindgen] | |
6 | extern "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 | } | |
14 | impl SpeechSynthesisErrorEventInit { | |
15 | #[cfg(all( | |
16 | feature = "SpeechSynthesisErrorCode", | |
17 | feature = "SpeechSynthesisUtterance", | |
18 | ))] | |
19 | #[doc = "Construct a new `SpeechSynthesisErrorEventInit`."] | |
20 | #[doc = ""] | |
21 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"] | |
22 | pub fn new(utterance: &SpeechSynthesisUtterance, error: SpeechSynthesisErrorCode) -> Self { | |
23 | #[allow(unused_mut)] | |
24 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); | |
25 | ret.utterance(utterance); | |
26 | ret.error(error); | |
27 | ret | |
28 | } | |
29 | #[doc = "Change the `bubbles` field of this object."] | |
30 | #[doc = ""] | |
31 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
32 | pub fn bubbles(&mut self, val: bool) -> &mut Self { | |
33 | use wasm_bindgen::JsValue; | |
34 | let r = ::js_sys::Reflect::set( | |
35 | self.as_ref(), | |
36 | &JsValue::from("bubbles"), | |
37 | &JsValue::from(val), | |
38 | ); | |
39 | debug_assert!( | |
40 | r.is_ok(), | |
41 | "setting properties should never fail on our dictionary objects" | |
42 | ); | |
43 | let _ = r; | |
44 | self | |
45 | } | |
46 | #[doc = "Change the `cancelable` field of this object."] | |
47 | #[doc = ""] | |
48 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
49 | pub fn cancelable(&mut self, val: bool) -> &mut Self { | |
50 | use wasm_bindgen::JsValue; | |
51 | let r = ::js_sys::Reflect::set( | |
52 | self.as_ref(), | |
53 | &JsValue::from("cancelable"), | |
54 | &JsValue::from(val), | |
55 | ); | |
56 | debug_assert!( | |
57 | r.is_ok(), | |
58 | "setting properties should never fail on our dictionary objects" | |
59 | ); | |
60 | let _ = r; | |
61 | self | |
62 | } | |
63 | #[doc = "Change the `composed` field of this object."] | |
64 | #[doc = ""] | |
65 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
66 | pub fn composed(&mut self, val: bool) -> &mut Self { | |
67 | use wasm_bindgen::JsValue; | |
68 | let r = ::js_sys::Reflect::set( | |
69 | self.as_ref(), | |
70 | &JsValue::from("composed"), | |
71 | &JsValue::from(val), | |
72 | ); | |
73 | debug_assert!( | |
74 | r.is_ok(), | |
75 | "setting properties should never fail on our dictionary objects" | |
76 | ); | |
77 | let _ = r; | |
78 | self | |
79 | } | |
80 | #[doc = "Change the `charIndex` field of this object."] | |
81 | #[doc = ""] | |
82 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
83 | pub fn char_index(&mut self, val: u32) -> &mut Self { | |
84 | use wasm_bindgen::JsValue; | |
85 | let r = ::js_sys::Reflect::set( | |
86 | self.as_ref(), | |
87 | &JsValue::from("charIndex"), | |
88 | &JsValue::from(val), | |
89 | ); | |
90 | debug_assert!( | |
91 | r.is_ok(), | |
92 | "setting properties should never fail on our dictionary objects" | |
93 | ); | |
94 | let _ = r; | |
95 | self | |
96 | } | |
97 | #[doc = "Change the `charLength` field of this object."] | |
98 | #[doc = ""] | |
99 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
100 | pub fn char_length(&mut self, val: Option<u32>) -> &mut Self { | |
101 | use wasm_bindgen::JsValue; | |
102 | let r = ::js_sys::Reflect::set( | |
103 | self.as_ref(), | |
104 | &JsValue::from("charLength"), | |
105 | &JsValue::from(val), | |
106 | ); | |
107 | debug_assert!( | |
108 | r.is_ok(), | |
109 | "setting properties should never fail on our dictionary objects" | |
110 | ); | |
111 | let _ = r; | |
112 | self | |
113 | } | |
114 | #[doc = "Change the `elapsedTime` field of this object."] | |
115 | #[doc = ""] | |
116 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
117 | pub fn elapsed_time(&mut self, val: f32) -> &mut Self { | |
118 | use wasm_bindgen::JsValue; | |
119 | let r = ::js_sys::Reflect::set( | |
120 | self.as_ref(), | |
121 | &JsValue::from("elapsedTime"), | |
122 | &JsValue::from(val), | |
123 | ); | |
124 | debug_assert!( | |
125 | r.is_ok(), | |
126 | "setting properties should never fail on our dictionary objects" | |
127 | ); | |
128 | let _ = r; | |
129 | self | |
130 | } | |
131 | #[doc = "Change the `name` field of this object."] | |
132 | #[doc = ""] | |
133 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] | |
134 | pub fn name(&mut self, val: &str) -> &mut Self { | |
135 | use wasm_bindgen::JsValue; | |
136 | let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); | |
137 | debug_assert!( | |
138 | r.is_ok(), | |
139 | "setting properties should never fail on our dictionary objects" | |
140 | ); | |
141 | let _ = r; | |
142 | self | |
143 | } | |
144 | #[cfg(feature = "SpeechSynthesisUtterance")] | |
145 | #[doc = "Change the `utterance` field of this object."] | |
146 | #[doc = ""] | |
147 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"] | |
148 | pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self { | |
149 | use wasm_bindgen::JsValue; | |
150 | let r = ::js_sys::Reflect::set( | |
151 | self.as_ref(), | |
152 | &JsValue::from("utterance"), | |
153 | &JsValue::from(val), | |
154 | ); | |
155 | debug_assert!( | |
156 | r.is_ok(), | |
157 | "setting properties should never fail on our dictionary objects" | |
158 | ); | |
159 | let _ = r; | |
160 | self | |
161 | } | |
162 | #[cfg(feature = "SpeechSynthesisErrorCode")] | |
163 | #[doc = "Change the `error` field of this object."] | |
164 | #[doc = ""] | |
165 | #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"] | |
166 | pub fn error(&mut self, val: SpeechSynthesisErrorCode) -> &mut Self { | |
167 | use wasm_bindgen::JsValue; | |
168 | let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); | |
169 | debug_assert!( | |
170 | r.is_ok(), | |
171 | "setting properties should never fail on our dictionary objects" | |
172 | ); | |
173 | let _ = r; | |
174 | self | |
175 | } | |
176 | } |