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