web_sys/features/
gen_SpeechRecognitionEventInit.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 = SpeechRecognitionEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `SpeechRecognitionEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
12    pub type SpeechRecognitionEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &SpeechRecognitionEventInit) -> 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: `SpeechRecognitionEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &SpeechRecognitionEventInit, 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: `SpeechRecognitionEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &SpeechRecognitionEventInit) -> 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: `SpeechRecognitionEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &SpeechRecognitionEventInit, 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: `SpeechRecognitionEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &SpeechRecognitionEventInit) -> 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: `SpeechRecognitionEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &SpeechRecognitionEventInit, val: bool);
43    #[cfg(feature = "Document")]
44    #[doc = "Get the `emma` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `Document`, `SpeechRecognitionEventInit`*"]
47    #[wasm_bindgen(method, getter = "emma")]
48    pub fn get_emma(this: &SpeechRecognitionEventInit) -> Option<Document>;
49    #[cfg(feature = "Document")]
50    #[doc = "Change the `emma` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `Document`, `SpeechRecognitionEventInit`*"]
53    #[wasm_bindgen(method, setter = "emma")]
54    pub fn set_emma(this: &SpeechRecognitionEventInit, val: Option<&Document>);
55    #[doc = "Get the `interpretation` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
58    #[wasm_bindgen(method, getter = "interpretation")]
59    pub fn get_interpretation(this: &SpeechRecognitionEventInit) -> ::wasm_bindgen::JsValue;
60    #[doc = "Change the `interpretation` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
63    #[wasm_bindgen(method, setter = "interpretation")]
64    pub fn set_interpretation(this: &SpeechRecognitionEventInit, val: &::wasm_bindgen::JsValue);
65    #[doc = "Get the `resultIndex` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
68    #[wasm_bindgen(method, getter = "resultIndex")]
69    pub fn get_result_index(this: &SpeechRecognitionEventInit) -> Option<u32>;
70    #[doc = "Change the `resultIndex` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
73    #[wasm_bindgen(method, setter = "resultIndex")]
74    pub fn set_result_index(this: &SpeechRecognitionEventInit, val: u32);
75    #[cfg(feature = "SpeechRecognitionResultList")]
76    #[doc = "Get the `results` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`, `SpeechRecognitionResultList`*"]
79    #[wasm_bindgen(method, getter = "results")]
80    pub fn get_results(this: &SpeechRecognitionEventInit) -> Option<SpeechRecognitionResultList>;
81    #[cfg(feature = "SpeechRecognitionResultList")]
82    #[doc = "Change the `results` field of this object."]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`, `SpeechRecognitionResultList`*"]
85    #[wasm_bindgen(method, setter = "results")]
86    pub fn set_results(
87        this: &SpeechRecognitionEventInit,
88        val: Option<&SpeechRecognitionResultList>,
89    );
90}
91impl SpeechRecognitionEventInit {
92    #[doc = "Construct a new `SpeechRecognitionEventInit`."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"]
95    pub fn new() -> Self {
96        #[allow(unused_mut)]
97        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
98        ret
99    }
100    #[deprecated = "Use `set_bubbles()` instead."]
101    pub fn bubbles(&mut self, val: bool) -> &mut Self {
102        self.set_bubbles(val);
103        self
104    }
105    #[deprecated = "Use `set_cancelable()` instead."]
106    pub fn cancelable(&mut self, val: bool) -> &mut Self {
107        self.set_cancelable(val);
108        self
109    }
110    #[deprecated = "Use `set_composed()` instead."]
111    pub fn composed(&mut self, val: bool) -> &mut Self {
112        self.set_composed(val);
113        self
114    }
115    #[cfg(feature = "Document")]
116    #[deprecated = "Use `set_emma()` instead."]
117    pub fn emma(&mut self, val: Option<&Document>) -> &mut Self {
118        self.set_emma(val);
119        self
120    }
121    #[deprecated = "Use `set_interpretation()` instead."]
122    pub fn interpretation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
123        self.set_interpretation(val);
124        self
125    }
126    #[deprecated = "Use `set_result_index()` instead."]
127    pub fn result_index(&mut self, val: u32) -> &mut Self {
128        self.set_result_index(val);
129        self
130    }
131    #[cfg(feature = "SpeechRecognitionResultList")]
132    #[deprecated = "Use `set_results()` instead."]
133    pub fn results(&mut self, val: Option<&SpeechRecognitionResultList>) -> &mut Self {
134        self.set_results(val);
135        self
136    }
137}
138impl Default for SpeechRecognitionEventInit {
139    fn default() -> Self {
140        Self::new()
141    }
142}