Skip to main content

web_sys/features/
gen_FileReaderSync.rs

1#![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 = "FileReaderSync",
10        typescript_type = "FileReaderSync"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `FileReaderSync` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `FileReaderSync`*"]
18    pub type FileReaderSync;
19    #[wasm_bindgen(catch, constructor, js_class = "FileReaderSync")]
20    #[doc = "The `new FileReaderSync(..)` constructor, creating a new instance of `FileReaderSync`."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/FileReaderSync)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `FileReaderSync`*"]
25    pub fn new() -> Result<FileReaderSync, JsValue>;
26    #[cfg(feature = "Blob")]
27    #[wasm_bindgen(
28        catch,
29        method,
30        js_class = "FileReaderSync",
31        js_name = "readAsArrayBuffer"
32    )]
33    #[doc = "The `readAsArrayBuffer()` method."]
34    #[doc = ""]
35    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsArrayBuffer)"]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"]
38    pub fn read_as_array_buffer(
39        this: &FileReaderSync,
40        blob: &Blob,
41    ) -> Result<::js_sys::ArrayBuffer, JsValue>;
42    #[cfg(feature = "Blob")]
43    #[wasm_bindgen(
44        catch,
45        method,
46        js_class = "FileReaderSync",
47        js_name = "readAsBinaryString"
48    )]
49    #[doc = "The `readAsBinaryString()` method."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsBinaryString)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"]
54    pub fn read_as_binary_string(
55        this: &FileReaderSync,
56        blob: &Blob,
57    ) -> Result<::alloc::string::String, JsValue>;
58    #[cfg(feature = "Blob")]
59    #[wasm_bindgen(catch, method, js_class = "FileReaderSync", js_name = "readAsDataURL")]
60    #[doc = "The `readAsDataURL()` method."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsDataURL)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"]
65    pub fn read_as_data_url(
66        this: &FileReaderSync,
67        blob: &Blob,
68    ) -> Result<::alloc::string::String, JsValue>;
69    #[cfg(feature = "Blob")]
70    #[wasm_bindgen(catch, method, js_class = "FileReaderSync", js_name = "readAsText")]
71    #[doc = "The `readAsText()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsText)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"]
76    pub fn read_as_text(
77        this: &FileReaderSync,
78        blob: &Blob,
79    ) -> Result<::alloc::string::String, JsValue>;
80    #[cfg(feature = "Blob")]
81    #[wasm_bindgen(catch, method, js_class = "FileReaderSync", js_name = "readAsText")]
82    #[doc = "The `readAsText()` method."]
83    #[doc = ""]
84    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsText)"]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"]
87    pub fn read_as_text_with_encoding(
88        this: &FileReaderSync,
89        blob: &Blob,
90        encoding: &str,
91    ) -> Result<::alloc::string::String, JsValue>;
92}