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