Skip to main content

web_sys/features/
gen_SpeechRecognitionError.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "Event",
9        extends = "::js_sys::Object",
10        js_name = "SpeechRecognitionError",
11        typescript_type = "SpeechRecognitionError"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `SpeechRecognitionError` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionError)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionError`*"]
19    pub type SpeechRecognitionError;
20    #[cfg(feature = "SpeechRecognitionErrorCode")]
21    #[wasm_bindgen(method, getter, js_class = "SpeechRecognitionError", js_name = "error")]
22    #[doc = "Getter for the `error` field of this object."]
23    #[doc = ""]
24    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionError/error)"]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionError`, `SpeechRecognitionErrorCode`*"]
27    pub fn error(this: &SpeechRecognitionError) -> SpeechRecognitionErrorCode;
28    #[wasm_bindgen(
29        method,
30        getter,
31        js_class = "SpeechRecognitionError",
32        js_name = "message"
33    )]
34    #[doc = "Getter for the `message` field of this object."]
35    #[doc = ""]
36    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionError/message)"]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionError`*"]
39    pub fn message(this: &SpeechRecognitionError) -> Option<::alloc::string::String>;
40    #[wasm_bindgen(catch, constructor, js_class = "SpeechRecognitionError")]
41    #[doc = "The `new SpeechRecognitionError(..)` constructor, creating a new instance of `SpeechRecognitionError`."]
42    #[doc = ""]
43    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionError/SpeechRecognitionError)"]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionError`*"]
46    pub fn new(type_: &str) -> Result<SpeechRecognitionError, JsValue>;
47    #[cfg(feature = "SpeechRecognitionErrorInit")]
48    #[wasm_bindgen(catch, constructor, js_class = "SpeechRecognitionError")]
49    #[doc = "The `new SpeechRecognitionError(..)` constructor, creating a new instance of `SpeechRecognitionError`."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionError/SpeechRecognitionError)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionError`, `SpeechRecognitionErrorInit`*"]
54    pub fn new_with_event_init_dict(
55        type_: &str,
56        event_init_dict: &SpeechRecognitionErrorInit,
57    ) -> Result<SpeechRecognitionError, JsValue>;
58}