maxcountryman_web_sys/features/
gen_FileReader.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = FileReader , typescript_type = "FileReader")]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `FileReader` class."]
9 #[doc = ""]
10 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader)"]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
13 pub type FileReader;
14 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = readyState)]
15 #[doc = "Getter for the `readyState` field of this object."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
20 pub fn ready_state(this: &FileReader) -> u16;
21 # [wasm_bindgen (structural , catch , method , getter , js_class = "FileReader" , js_name = result)]
22 #[doc = "Getter for the `result` field of this object."]
23 #[doc = ""]
24 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/result)"]
25 #[doc = ""]
26 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
27 pub fn result(this: &FileReader) -> Result<::wasm_bindgen::JsValue, JsValue>;
28 #[cfg(feature = "DomException")]
29 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = error)]
30 #[doc = "Getter for the `error` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/error)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `DomException`, `FileReader`*"]
35 pub fn error(this: &FileReader) -> Option<DomException>;
36 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = onloadstart)]
37 #[doc = "Getter for the `onloadstart` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onloadstart)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
42 pub fn onloadstart(this: &FileReader) -> Option<::js_sys::Function>;
43 # [wasm_bindgen (structural , method , setter , js_class = "FileReader" , js_name = onloadstart)]
44 #[doc = "Setter for the `onloadstart` field of this object."]
45 #[doc = ""]
46 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onloadstart)"]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
49 pub fn set_onloadstart(this: &FileReader, value: Option<&::js_sys::Function>);
50 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = onprogress)]
51 #[doc = "Getter for the `onprogress` field of this object."]
52 #[doc = ""]
53 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onprogress)"]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
56 pub fn onprogress(this: &FileReader) -> Option<::js_sys::Function>;
57 # [wasm_bindgen (structural , method , setter , js_class = "FileReader" , js_name = onprogress)]
58 #[doc = "Setter for the `onprogress` field of this object."]
59 #[doc = ""]
60 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onprogress)"]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
63 pub fn set_onprogress(this: &FileReader, value: Option<&::js_sys::Function>);
64 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = onload)]
65 #[doc = "Getter for the `onload` field of this object."]
66 #[doc = ""]
67 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onload)"]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
70 pub fn onload(this: &FileReader) -> Option<::js_sys::Function>;
71 # [wasm_bindgen (structural , method , setter , js_class = "FileReader" , js_name = onload)]
72 #[doc = "Setter for the `onload` field of this object."]
73 #[doc = ""]
74 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onload)"]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
77 pub fn set_onload(this: &FileReader, value: Option<&::js_sys::Function>);
78 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = onabort)]
79 #[doc = "Getter for the `onabort` field of this object."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onabort)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
84 pub fn onabort(this: &FileReader) -> Option<::js_sys::Function>;
85 # [wasm_bindgen (structural , method , setter , js_class = "FileReader" , js_name = onabort)]
86 #[doc = "Setter for the `onabort` field of this object."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onabort)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
91 pub fn set_onabort(this: &FileReader, value: Option<&::js_sys::Function>);
92 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = onerror)]
93 #[doc = "Getter for the `onerror` field of this object."]
94 #[doc = ""]
95 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onerror)"]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
98 pub fn onerror(this: &FileReader) -> Option<::js_sys::Function>;
99 # [wasm_bindgen (structural , method , setter , js_class = "FileReader" , js_name = onerror)]
100 #[doc = "Setter for the `onerror` field of this object."]
101 #[doc = ""]
102 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onerror)"]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
105 pub fn set_onerror(this: &FileReader, value: Option<&::js_sys::Function>);
106 # [wasm_bindgen (structural , method , getter , js_class = "FileReader" , js_name = onloadend)]
107 #[doc = "Getter for the `onloadend` field of this object."]
108 #[doc = ""]
109 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onloadend)"]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
112 pub fn onloadend(this: &FileReader) -> Option<::js_sys::Function>;
113 # [wasm_bindgen (structural , method , setter , js_class = "FileReader" , js_name = onloadend)]
114 #[doc = "Setter for the `onloadend` field of this object."]
115 #[doc = ""]
116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onloadend)"]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
119 pub fn set_onloadend(this: &FileReader, value: Option<&::js_sys::Function>);
120 #[wasm_bindgen(catch, constructor, js_class = "FileReader")]
121 #[doc = "The `new FileReader(..)` constructor, creating a new instance of `FileReader`."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/FileReader)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
126 pub fn new() -> Result<FileReader, JsValue>;
127 # [wasm_bindgen (method , structural , js_class = "FileReader" , js_name = abort)]
128 #[doc = "The `abort()` method."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/abort)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
133 pub fn abort(this: &FileReader);
134 #[cfg(feature = "Blob")]
135 # [wasm_bindgen (catch , method , structural , js_class = "FileReader" , js_name = readAsArrayBuffer)]
136 #[doc = "The `readAsArrayBuffer()` method."]
137 #[doc = ""]
138 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsArrayBuffer)"]
139 #[doc = ""]
140 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReader`*"]
141 pub fn read_as_array_buffer(this: &FileReader, blob: &Blob) -> Result<(), JsValue>;
142 #[cfg(feature = "Blob")]
143 # [wasm_bindgen (catch , method , structural , js_class = "FileReader" , js_name = readAsBinaryString)]
144 #[doc = "The `readAsBinaryString()` method."]
145 #[doc = ""]
146 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsBinaryString)"]
147 #[doc = ""]
148 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReader`*"]
149 pub fn read_as_binary_string(this: &FileReader, filedata: &Blob) -> Result<(), JsValue>;
150 #[cfg(feature = "Blob")]
151 # [wasm_bindgen (catch , method , structural , js_class = "FileReader" , js_name = readAsDataURL)]
152 #[doc = "The `readAsDataURL()` method."]
153 #[doc = ""]
154 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL)"]
155 #[doc = ""]
156 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReader`*"]
157 pub fn read_as_data_url(this: &FileReader, blob: &Blob) -> Result<(), JsValue>;
158 #[cfg(feature = "Blob")]
159 # [wasm_bindgen (catch , method , structural , js_class = "FileReader" , js_name = readAsText)]
160 #[doc = "The `readAsText()` method."]
161 #[doc = ""]
162 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText)"]
163 #[doc = ""]
164 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReader`*"]
165 pub fn read_as_text(this: &FileReader, blob: &Blob) -> Result<(), JsValue>;
166 #[cfg(feature = "Blob")]
167 # [wasm_bindgen (catch , method , structural , js_class = "FileReader" , js_name = readAsText)]
168 #[doc = "The `readAsText()` method."]
169 #[doc = ""]
170 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText)"]
171 #[doc = ""]
172 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReader`*"]
173 pub fn read_as_text_with_label(
174 this: &FileReader,
175 blob: &Blob,
176 label: &str,
177 ) -> Result<(), JsValue>;
178}
179impl FileReader {
180 #[doc = "The `FileReader.EMPTY` const."]
181 #[doc = ""]
182 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
183 pub const EMPTY: u16 = 0i64 as u16;
184 #[doc = "The `FileReader.LOADING` const."]
185 #[doc = ""]
186 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
187 pub const LOADING: u16 = 1u64 as u16;
188 #[doc = "The `FileReader.DONE` const."]
189 #[doc = ""]
190 #[doc = "*This API requires the following crate features to be activated: `FileReader`*"]
191 pub const DONE: u16 = 2u64 as u16;
192}