web_sys/features/
gen_TextTrack.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "TextTrack",
11 typescript_type = "TextTrack"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `TextTrack` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
19 pub type TextTrack;
20 #[cfg(feature = "TextTrackKind")]
21 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "kind")]
22 #[doc = "Getter for the `kind` field of this object."]
23 #[doc = ""]
24 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/kind)"]
25 #[doc = ""]
26 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `TextTrackKind`*"]
27 pub fn kind(this: &TextTrack) -> TextTrackKind;
28 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "label")]
29 #[doc = "Getter for the `label` field of this object."]
30 #[doc = ""]
31 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/label)"]
32 #[doc = ""]
33 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
34 pub fn label(this: &TextTrack) -> ::alloc::string::String;
35 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "language")]
36 #[doc = "Getter for the `language` field of this object."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/language)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
41 pub fn language(this: &TextTrack) -> ::alloc::string::String;
42 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "id")]
43 #[doc = "Getter for the `id` field of this object."]
44 #[doc = ""]
45 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/id)"]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
48 pub fn id(this: &TextTrack) -> ::alloc::string::String;
49 #[wasm_bindgen(
50 method,
51 getter,
52 js_class = "TextTrack",
53 js_name = "inBandMetadataTrackDispatchType"
54 )]
55 #[doc = "Getter for the `inBandMetadataTrackDispatchType` field of this object."]
56 #[doc = ""]
57 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/inBandMetadataTrackDispatchType)"]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
60 pub fn in_band_metadata_track_dispatch_type(this: &TextTrack) -> ::alloc::string::String;
61 #[cfg(feature = "TextTrackMode")]
62 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "mode")]
63 #[doc = "Getter for the `mode` field of this object."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/mode)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `TextTrackMode`*"]
68 pub fn mode(this: &TextTrack) -> TextTrackMode;
69 #[cfg(feature = "TextTrackMode")]
70 #[wasm_bindgen(method, setter, js_class = "TextTrack", js_name = "mode")]
71 #[doc = "Setter for the `mode` field of this object."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/mode)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `TextTrackMode`*"]
76 pub fn set_mode(this: &TextTrack, value: TextTrackMode);
77 #[cfg(feature = "TextTrackCueList")]
78 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "cues")]
79 #[doc = "Getter for the `cues` field of this object."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/cues)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `TextTrackCueList`*"]
84 pub fn cues(this: &TextTrack) -> Option<TextTrackCueList>;
85 #[cfg(feature = "TextTrackCueList")]
86 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "activeCues")]
87 #[doc = "Getter for the `activeCues` field of this object."]
88 #[doc = ""]
89 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/activeCues)"]
90 #[doc = ""]
91 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `TextTrackCueList`*"]
92 pub fn active_cues(this: &TextTrack) -> Option<TextTrackCueList>;
93 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "oncuechange")]
94 #[doc = "Getter for the `oncuechange` field of this object."]
95 #[doc = ""]
96 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/oncuechange)"]
97 #[doc = ""]
98 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
99 pub fn oncuechange(this: &TextTrack) -> Option<::js_sys::Function>;
100 #[wasm_bindgen(method, setter, js_class = "TextTrack", js_name = "oncuechange")]
101 #[doc = "Setter for the `oncuechange` field of this object."]
102 #[doc = ""]
103 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/oncuechange)"]
104 #[doc = ""]
105 #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"]
106 pub fn set_oncuechange(this: &TextTrack, value: Option<&::js_sys::Function>);
107 #[cfg(feature = "SourceBuffer")]
108 #[wasm_bindgen(method, getter, js_class = "TextTrack", js_name = "sourceBuffer")]
109 #[doc = "Getter for the `sourceBuffer` field of this object."]
110 #[doc = ""]
111 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/sourceBuffer)"]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`, `TextTrack`*"]
114 pub fn source_buffer(this: &TextTrack) -> Option<SourceBuffer>;
115 #[cfg(feature = "VttCue")]
116 #[wasm_bindgen(method, js_class = "TextTrack", js_name = "addCue")]
117 #[doc = "The `addCue()` method."]
118 #[doc = ""]
119 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/addCue)"]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `VttCue`*"]
122 pub fn add_cue(this: &TextTrack, cue: &VttCue);
123 #[cfg(feature = "VttCue")]
124 #[wasm_bindgen(catch, method, js_class = "TextTrack", js_name = "removeCue")]
125 #[doc = "The `removeCue()` method."]
126 #[doc = ""]
127 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/removeCue)"]
128 #[doc = ""]
129 #[doc = "*This API requires the following crate features to be activated: `TextTrack`, `VttCue`*"]
130 pub fn remove_cue(this: &TextTrack, cue: &VttCue) -> Result<(), JsValue>;
131}