maxcountryman_web_sys/features/
gen_TextDecoder.rs

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