web_sys/features/
gen_SpeechRecognition.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = SpeechRecognition , typescript_type = "SpeechRecognition")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `SpeechRecognition` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
14    pub type SpeechRecognition;
15    #[cfg(feature = "SpeechGrammarList")]
16    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = grammars)]
17    #[doc = "Getter for the `grammars` field of this object."]
18    #[doc = ""]
19    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/grammars)"]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `SpeechGrammarList`, `SpeechRecognition`*"]
22    pub fn grammars(this: &SpeechRecognition) -> SpeechGrammarList;
23    #[cfg(feature = "SpeechGrammarList")]
24    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = grammars)]
25    #[doc = "Setter for the `grammars` field of this object."]
26    #[doc = ""]
27    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/grammars)"]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `SpeechGrammarList`, `SpeechRecognition`*"]
30    pub fn set_grammars(this: &SpeechRecognition, value: &SpeechGrammarList);
31    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = lang)]
32    #[doc = "Getter for the `lang` field of this object."]
33    #[doc = ""]
34    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/lang)"]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
37    pub fn lang(this: &SpeechRecognition) -> ::alloc::string::String;
38    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = lang)]
39    #[doc = "Setter for the `lang` field of this object."]
40    #[doc = ""]
41    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/lang)"]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
44    pub fn set_lang(this: &SpeechRecognition, value: &str);
45    # [wasm_bindgen (structural , catch , method , getter , js_class = "SpeechRecognition" , js_name = continuous)]
46    #[doc = "Getter for the `continuous` field of this object."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/continuous)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
51    pub fn continuous(this: &SpeechRecognition) -> Result<bool, JsValue>;
52    # [wasm_bindgen (structural , catch , method , setter , js_class = "SpeechRecognition" , js_name = continuous)]
53    #[doc = "Setter for the `continuous` field of this object."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/continuous)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
58    pub fn set_continuous(this: &SpeechRecognition, value: bool) -> Result<(), JsValue>;
59    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = interimResults)]
60    #[doc = "Getter for the `interimResults` field of this object."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/interimResults)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
65    pub fn interim_results(this: &SpeechRecognition) -> bool;
66    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = interimResults)]
67    #[doc = "Setter for the `interimResults` field of this object."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/interimResults)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
72    pub fn set_interim_results(this: &SpeechRecognition, value: bool);
73    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = maxAlternatives)]
74    #[doc = "Getter for the `maxAlternatives` field of this object."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/maxAlternatives)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
79    pub fn max_alternatives(this: &SpeechRecognition) -> u32;
80    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = maxAlternatives)]
81    #[doc = "Setter for the `maxAlternatives` field of this object."]
82    #[doc = ""]
83    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/maxAlternatives)"]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
86    pub fn set_max_alternatives(this: &SpeechRecognition, value: u32);
87    # [wasm_bindgen (structural , catch , method , getter , js_class = "SpeechRecognition" , js_name = serviceURI)]
88    #[doc = "Getter for the `serviceURI` field of this object."]
89    #[doc = ""]
90    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/serviceURI)"]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
93    pub fn service_uri(this: &SpeechRecognition) -> Result<::alloc::string::String, JsValue>;
94    # [wasm_bindgen (structural , catch , method , setter , js_class = "SpeechRecognition" , js_name = serviceURI)]
95    #[doc = "Setter for the `serviceURI` field of this object."]
96    #[doc = ""]
97    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/serviceURI)"]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
100    pub fn set_service_uri(this: &SpeechRecognition, value: &str) -> Result<(), JsValue>;
101    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onaudiostart)]
102    #[doc = "Getter for the `onaudiostart` field of this object."]
103    #[doc = ""]
104    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onaudiostart)"]
105    #[doc = ""]
106    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
107    pub fn onaudiostart(this: &SpeechRecognition) -> Option<::js_sys::Function>;
108    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onaudiostart)]
109    #[doc = "Setter for the `onaudiostart` field of this object."]
110    #[doc = ""]
111    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onaudiostart)"]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
114    pub fn set_onaudiostart(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
115    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onsoundstart)]
116    #[doc = "Getter for the `onsoundstart` field of this object."]
117    #[doc = ""]
118    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onsoundstart)"]
119    #[doc = ""]
120    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
121    pub fn onsoundstart(this: &SpeechRecognition) -> Option<::js_sys::Function>;
122    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onsoundstart)]
123    #[doc = "Setter for the `onsoundstart` field of this object."]
124    #[doc = ""]
125    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onsoundstart)"]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
128    pub fn set_onsoundstart(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
129    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onspeechstart)]
130    #[doc = "Getter for the `onspeechstart` field of this object."]
131    #[doc = ""]
132    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onspeechstart)"]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
135    pub fn onspeechstart(this: &SpeechRecognition) -> Option<::js_sys::Function>;
136    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onspeechstart)]
137    #[doc = "Setter for the `onspeechstart` field of this object."]
138    #[doc = ""]
139    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onspeechstart)"]
140    #[doc = ""]
141    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
142    pub fn set_onspeechstart(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
143    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onspeechend)]
144    #[doc = "Getter for the `onspeechend` field of this object."]
145    #[doc = ""]
146    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onspeechend)"]
147    #[doc = ""]
148    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
149    pub fn onspeechend(this: &SpeechRecognition) -> Option<::js_sys::Function>;
150    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onspeechend)]
151    #[doc = "Setter for the `onspeechend` field of this object."]
152    #[doc = ""]
153    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onspeechend)"]
154    #[doc = ""]
155    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
156    pub fn set_onspeechend(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
157    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onsoundend)]
158    #[doc = "Getter for the `onsoundend` field of this object."]
159    #[doc = ""]
160    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onsoundend)"]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
163    pub fn onsoundend(this: &SpeechRecognition) -> Option<::js_sys::Function>;
164    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onsoundend)]
165    #[doc = "Setter for the `onsoundend` field of this object."]
166    #[doc = ""]
167    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onsoundend)"]
168    #[doc = ""]
169    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
170    pub fn set_onsoundend(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
171    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onaudioend)]
172    #[doc = "Getter for the `onaudioend` field of this object."]
173    #[doc = ""]
174    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onaudioend)"]
175    #[doc = ""]
176    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
177    pub fn onaudioend(this: &SpeechRecognition) -> Option<::js_sys::Function>;
178    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onaudioend)]
179    #[doc = "Setter for the `onaudioend` field of this object."]
180    #[doc = ""]
181    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onaudioend)"]
182    #[doc = ""]
183    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
184    pub fn set_onaudioend(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
185    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onresult)]
186    #[doc = "Getter for the `onresult` field of this object."]
187    #[doc = ""]
188    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onresult)"]
189    #[doc = ""]
190    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
191    pub fn onresult(this: &SpeechRecognition) -> Option<::js_sys::Function>;
192    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onresult)]
193    #[doc = "Setter for the `onresult` field of this object."]
194    #[doc = ""]
195    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onresult)"]
196    #[doc = ""]
197    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
198    pub fn set_onresult(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
199    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onnomatch)]
200    #[doc = "Getter for the `onnomatch` field of this object."]
201    #[doc = ""]
202    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onnomatch)"]
203    #[doc = ""]
204    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
205    pub fn onnomatch(this: &SpeechRecognition) -> Option<::js_sys::Function>;
206    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onnomatch)]
207    #[doc = "Setter for the `onnomatch` field of this object."]
208    #[doc = ""]
209    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onnomatch)"]
210    #[doc = ""]
211    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
212    pub fn set_onnomatch(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
213    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onerror)]
214    #[doc = "Getter for the `onerror` field of this object."]
215    #[doc = ""]
216    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onerror)"]
217    #[doc = ""]
218    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
219    pub fn onerror(this: &SpeechRecognition) -> Option<::js_sys::Function>;
220    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onerror)]
221    #[doc = "Setter for the `onerror` field of this object."]
222    #[doc = ""]
223    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onerror)"]
224    #[doc = ""]
225    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
226    pub fn set_onerror(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
227    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onstart)]
228    #[doc = "Getter for the `onstart` field of this object."]
229    #[doc = ""]
230    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onstart)"]
231    #[doc = ""]
232    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
233    pub fn onstart(this: &SpeechRecognition) -> Option<::js_sys::Function>;
234    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onstart)]
235    #[doc = "Setter for the `onstart` field of this object."]
236    #[doc = ""]
237    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onstart)"]
238    #[doc = ""]
239    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
240    pub fn set_onstart(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
241    # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognition" , js_name = onend)]
242    #[doc = "Getter for the `onend` field of this object."]
243    #[doc = ""]
244    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onend)"]
245    #[doc = ""]
246    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
247    pub fn onend(this: &SpeechRecognition) -> Option<::js_sys::Function>;
248    # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = onend)]
249    #[doc = "Setter for the `onend` field of this object."]
250    #[doc = ""]
251    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onend)"]
252    #[doc = ""]
253    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
254    pub fn set_onend(this: &SpeechRecognition, value: Option<&::js_sys::Function>);
255    #[wasm_bindgen(catch, constructor, js_class = "SpeechRecognition")]
256    #[doc = "The `new SpeechRecognition(..)` constructor, creating a new instance of `SpeechRecognition`."]
257    #[doc = ""]
258    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/SpeechRecognition)"]
259    #[doc = ""]
260    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
261    pub fn new() -> Result<SpeechRecognition, JsValue>;
262    # [wasm_bindgen (method , structural , js_class = "SpeechRecognition" , js_name = abort)]
263    #[doc = "The `abort()` method."]
264    #[doc = ""]
265    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/abort)"]
266    #[doc = ""]
267    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
268    pub fn abort(this: &SpeechRecognition);
269    # [wasm_bindgen (catch , method , structural , js_class = "SpeechRecognition" , js_name = start)]
270    #[doc = "The `start()` method."]
271    #[doc = ""]
272    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/start)"]
273    #[doc = ""]
274    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
275    pub fn start(this: &SpeechRecognition) -> Result<(), JsValue>;
276    #[cfg(feature = "MediaStream")]
277    # [wasm_bindgen (catch , method , structural , js_class = "SpeechRecognition" , js_name = start)]
278    #[doc = "The `start()` method."]
279    #[doc = ""]
280    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/start)"]
281    #[doc = ""]
282    #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `SpeechRecognition`*"]
283    pub fn start_with_stream(this: &SpeechRecognition, stream: &MediaStream)
284        -> Result<(), JsValue>;
285    # [wasm_bindgen (method , structural , js_class = "SpeechRecognition" , js_name = stop)]
286    #[doc = "The `stop()` method."]
287    #[doc = ""]
288    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/stop)"]
289    #[doc = ""]
290    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"]
291    pub fn stop(this: &SpeechRecognition);
292}