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