web_sys/features/
gen_SpeechSynthesisEvent.rs

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