Skip to main content

web_sys/features/
gen_Blob.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 = "Blob",
10        typescript_type = "Blob"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `Blob` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
18    pub type Blob;
19    #[wasm_bindgen(method, getter, js_class = "Blob", js_name = "size")]
20    #[doc = "Getter for the `size` field of this object."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/size)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
25    pub fn size(this: &Blob) -> f64;
26    #[wasm_bindgen(method, getter, js_class = "Blob", js_name = "type")]
27    #[doc = "Getter for the `type` field of this object."]
28    #[doc = ""]
29    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/type)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
32    pub fn type_(this: &Blob) -> ::alloc::string::String;
33    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
34    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
35    #[doc = ""]
36    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
39    pub fn new() -> Result<Blob, JsValue>;
40    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
41    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
42    #[doc = ""]
43    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
46    pub fn new_with_buffer_source_sequence(
47        blob_parts: &::wasm_bindgen::JsValue,
48    ) -> Result<Blob, JsValue>;
49    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
50    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
51    #[doc = ""]
52    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
55    pub fn new_with_u8_slice_sequence(
56        blob_parts: &::wasm_bindgen::JsValue,
57    ) -> Result<Blob, JsValue>;
58    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
59    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
60    #[doc = ""]
61    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
64    pub fn new_with_u8_array_sequence(
65        blob_parts: &::wasm_bindgen::JsValue,
66    ) -> Result<Blob, JsValue>;
67    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
68    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
69    #[doc = ""]
70    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
73    pub fn new_with_blob_sequence(blob_parts: &::wasm_bindgen::JsValue) -> Result<Blob, JsValue>;
74    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
75    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
76    #[doc = ""]
77    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
80    pub fn new_with_str_sequence(blob_parts: &::wasm_bindgen::JsValue) -> Result<Blob, JsValue>;
81    #[cfg(feature = "BlobPropertyBag")]
82    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
83    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
84    #[doc = ""]
85    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
88    pub fn new_with_buffer_source_sequence_and_options(
89        blob_parts: &::wasm_bindgen::JsValue,
90        options: &BlobPropertyBag,
91    ) -> Result<Blob, JsValue>;
92    #[cfg(feature = "BlobPropertyBag")]
93    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
94    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
95    #[doc = ""]
96    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
99    pub fn new_with_u8_slice_sequence_and_options(
100        blob_parts: &::wasm_bindgen::JsValue,
101        options: &BlobPropertyBag,
102    ) -> Result<Blob, JsValue>;
103    #[cfg(feature = "BlobPropertyBag")]
104    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
105    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
106    #[doc = ""]
107    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
108    #[doc = ""]
109    #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
110    pub fn new_with_u8_array_sequence_and_options(
111        blob_parts: &::wasm_bindgen::JsValue,
112        options: &BlobPropertyBag,
113    ) -> Result<Blob, JsValue>;
114    #[cfg(feature = "BlobPropertyBag")]
115    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
116    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
117    #[doc = ""]
118    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
119    #[doc = ""]
120    #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
121    pub fn new_with_blob_sequence_and_options(
122        blob_parts: &::wasm_bindgen::JsValue,
123        options: &BlobPropertyBag,
124    ) -> Result<Blob, JsValue>;
125    #[cfg(feature = "BlobPropertyBag")]
126    #[wasm_bindgen(catch, constructor, js_class = "Blob")]
127    #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
128    #[doc = ""]
129    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
130    #[doc = ""]
131    #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
132    pub fn new_with_str_sequence_and_options(
133        blob_parts: &::wasm_bindgen::JsValue,
134        options: &BlobPropertyBag,
135    ) -> Result<Blob, JsValue>;
136    #[wasm_bindgen(method, js_class = "Blob", js_name = "arrayBuffer")]
137    #[doc = "The `arrayBuffer()` method."]
138    #[doc = ""]
139    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/arrayBuffer)"]
140    #[doc = ""]
141    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
142    pub fn array_buffer(this: &Blob) -> ::js_sys::Promise;
143    #[wasm_bindgen(method, js_class = "Blob")]
144    #[doc = "The `bytes()` method."]
145    #[doc = ""]
146    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/bytes)"]
147    #[doc = ""]
148    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
149    pub fn bytes(this: &Blob) -> ::js_sys::Promise;
150    #[wasm_bindgen(catch, method, js_class = "Blob")]
151    #[doc = "The `slice()` method."]
152    #[doc = ""]
153    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
154    #[doc = ""]
155    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
156    pub fn slice(this: &Blob) -> Result<Blob, JsValue>;
157    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
158    #[doc = "The `slice()` method."]
159    #[doc = ""]
160    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
163    pub fn slice_with_i32(this: &Blob, start: i32) -> Result<Blob, JsValue>;
164    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
165    #[doc = "The `slice()` method."]
166    #[doc = ""]
167    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
168    #[doc = ""]
169    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
170    pub fn slice_with_f64(this: &Blob, start: f64) -> Result<Blob, JsValue>;
171    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
172    #[doc = "The `slice()` method."]
173    #[doc = ""]
174    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
175    #[doc = ""]
176    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
177    pub fn slice_with_i32_and_i32(this: &Blob, start: i32, end: i32) -> Result<Blob, JsValue>;
178    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
179    #[doc = "The `slice()` method."]
180    #[doc = ""]
181    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
182    #[doc = ""]
183    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
184    pub fn slice_with_f64_and_i32(this: &Blob, start: f64, end: i32) -> Result<Blob, JsValue>;
185    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
186    #[doc = "The `slice()` method."]
187    #[doc = ""]
188    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
189    #[doc = ""]
190    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
191    pub fn slice_with_i32_and_f64(this: &Blob, start: i32, end: f64) -> Result<Blob, JsValue>;
192    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
193    #[doc = "The `slice()` method."]
194    #[doc = ""]
195    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
196    #[doc = ""]
197    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
198    pub fn slice_with_f64_and_f64(this: &Blob, start: f64, end: f64) -> Result<Blob, JsValue>;
199    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
200    #[doc = "The `slice()` method."]
201    #[doc = ""]
202    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
203    #[doc = ""]
204    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
205    pub fn slice_with_i32_and_i32_and_content_type(
206        this: &Blob,
207        start: i32,
208        end: i32,
209        content_type: &str,
210    ) -> Result<Blob, JsValue>;
211    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
212    #[doc = "The `slice()` method."]
213    #[doc = ""]
214    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
215    #[doc = ""]
216    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
217    pub fn slice_with_f64_and_i32_and_content_type(
218        this: &Blob,
219        start: f64,
220        end: i32,
221        content_type: &str,
222    ) -> Result<Blob, JsValue>;
223    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
224    #[doc = "The `slice()` method."]
225    #[doc = ""]
226    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
227    #[doc = ""]
228    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
229    pub fn slice_with_i32_and_f64_and_content_type(
230        this: &Blob,
231        start: i32,
232        end: f64,
233        content_type: &str,
234    ) -> Result<Blob, JsValue>;
235    #[wasm_bindgen(catch, method, js_class = "Blob", js_name = "slice")]
236    #[doc = "The `slice()` method."]
237    #[doc = ""]
238    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
239    #[doc = ""]
240    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
241    pub fn slice_with_f64_and_f64_and_content_type(
242        this: &Blob,
243        start: f64,
244        end: f64,
245        content_type: &str,
246    ) -> Result<Blob, JsValue>;
247    #[cfg(feature = "ReadableStream")]
248    #[wasm_bindgen(method, js_class = "Blob")]
249    #[doc = "The `stream()` method."]
250    #[doc = ""]
251    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/stream)"]
252    #[doc = ""]
253    #[doc = "*This API requires the following crate features to be activated: `Blob`, `ReadableStream`*"]
254    pub fn stream(this: &Blob) -> ReadableStream;
255    #[wasm_bindgen(method, js_class = "Blob")]
256    #[doc = "The `text()` method."]
257    #[doc = ""]
258    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/text)"]
259    #[doc = ""]
260    #[doc = "*This API requires the following crate features to be activated: `Blob`*"]
261    pub fn text(this: &Blob) -> ::js_sys::Promise;
262}