web_sys/features/
gen_TextDecoder.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "::js_sys::Object",
9 js_name = "TextDecoder",
10 typescript_type = "TextDecoder"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `TextDecoder` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
18 pub type TextDecoder;
19 #[wasm_bindgen(method, getter, js_class = "TextDecoder", js_name = "encoding")]
20 #[doc = "Getter for the `encoding` field of this object."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/encoding)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
25 pub fn encoding(this: &TextDecoder) -> ::alloc::string::String;
26 #[wasm_bindgen(method, getter, js_class = "TextDecoder", js_name = "fatal")]
27 #[doc = "Getter for the `fatal` field of this object."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/fatal)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
32 pub fn fatal(this: &TextDecoder) -> bool;
33 #[wasm_bindgen(catch, constructor, js_class = "TextDecoder")]
34 #[doc = "The `new TextDecoder(..)` constructor, creating a new instance of `TextDecoder`."]
35 #[doc = ""]
36 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder)"]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
39 pub fn new() -> Result<TextDecoder, JsValue>;
40 #[wasm_bindgen(catch, constructor, js_class = "TextDecoder")]
41 #[doc = "The `new TextDecoder(..)` constructor, creating a new instance of `TextDecoder`."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
46 pub fn new_with_label(label: &str) -> Result<TextDecoder, JsValue>;
47 #[cfg(feature = "TextDecoderOptions")]
48 #[wasm_bindgen(catch, constructor, js_class = "TextDecoder")]
49 #[doc = "The `new TextDecoder(..)` constructor, creating a new instance of `TextDecoder`."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`, `TextDecoderOptions`*"]
54 pub fn new_with_label_and_options(
55 label: &str,
56 options: &TextDecoderOptions,
57 ) -> Result<TextDecoder, JsValue>;
58 #[wasm_bindgen(catch, method, js_class = "TextDecoder")]
59 #[doc = "The `decode()` method."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
64 pub fn decode(this: &TextDecoder) -> Result<::alloc::string::String, JsValue>;
65 #[wasm_bindgen(catch, method, js_class = "TextDecoder", js_name = "decode")]
66 #[doc = "The `decode()` method."]
67 #[doc = ""]
68 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
71 pub fn decode_with_buffer_source(
72 this: &TextDecoder,
73 input: &::js_sys::Object,
74 ) -> Result<::alloc::string::String, JsValue>;
75 #[wasm_bindgen(catch, method, js_class = "TextDecoder", js_name = "decode")]
76 #[doc = "The `decode()` method."]
77 #[doc = ""]
78 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
81 pub fn decode_with_u8_array(
82 this: &TextDecoder,
83 input: &[u8],
84 ) -> Result<::alloc::string::String, JsValue>;
85 #[wasm_bindgen(catch, method, js_class = "TextDecoder", js_name = "decode")]
86 #[doc = "The `decode()` method."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"]
91 pub fn decode_with_js_u8_array(
92 this: &TextDecoder,
93 input: &::js_sys::Uint8Array,
94 ) -> Result<::alloc::string::String, JsValue>;
95 #[cfg(feature = "TextDecodeOptions")]
96 #[wasm_bindgen(catch, method, js_class = "TextDecoder", js_name = "decode")]
97 #[doc = "The `decode()` method."]
98 #[doc = ""]
99 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
100 #[doc = ""]
101 #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`, `TextDecoder`*"]
102 pub fn decode_with_buffer_source_and_options(
103 this: &TextDecoder,
104 input: &::js_sys::Object,
105 options: &TextDecodeOptions,
106 ) -> Result<::alloc::string::String, JsValue>;
107 #[cfg(feature = "TextDecodeOptions")]
108 #[wasm_bindgen(catch, method, js_class = "TextDecoder", js_name = "decode")]
109 #[doc = "The `decode()` method."]
110 #[doc = ""]
111 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`, `TextDecoder`*"]
114 pub fn decode_with_u8_array_and_options(
115 this: &TextDecoder,
116 input: &[u8],
117 options: &TextDecodeOptions,
118 ) -> Result<::alloc::string::String, JsValue>;
119 #[cfg(feature = "TextDecodeOptions")]
120 #[wasm_bindgen(catch, method, js_class = "TextDecoder", js_name = "decode")]
121 #[doc = "The `decode()` method."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`, `TextDecoder`*"]
126 pub fn decode_with_js_u8_array_and_options(
127 this: &TextDecoder,
128 input: &::js_sys::Uint8Array,
129 options: &TextDecodeOptions,
130 ) -> Result<::alloc::string::String, JsValue>;
131}