Skip to main content

web_sys/features/
gen_File.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 = "Blob",
9        extends = "::js_sys::Object",
10        js_name = "File",
11        typescript_type = "File"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `File` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `File`*"]
19    pub type File;
20    #[wasm_bindgen(method, getter, js_class = "File", js_name = "name")]
21    #[doc = "Getter for the `name` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/name)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `File`*"]
26    pub fn name(this: &File) -> ::alloc::string::String;
27    #[wasm_bindgen(method, getter, js_class = "File", js_name = "lastModified")]
28    #[doc = "Getter for the `lastModified` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `File`*"]
33    pub fn last_modified(this: &File) -> f64;
34    #[wasm_bindgen(catch, constructor, js_class = "File")]
35    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `File`*"]
40    pub fn new_with_buffer_source_sequence(
41        file_bits: &::wasm_bindgen::JsValue,
42        file_name: &str,
43    ) -> Result<File, JsValue>;
44    #[wasm_bindgen(catch, constructor, js_class = "File")]
45    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
46    #[doc = ""]
47    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `File`*"]
50    pub fn new_with_u8_slice_sequence(
51        file_bits: &::wasm_bindgen::JsValue,
52        file_name: &str,
53    ) -> Result<File, JsValue>;
54    #[wasm_bindgen(catch, constructor, js_class = "File")]
55    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
56    #[doc = ""]
57    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `File`*"]
60    pub fn new_with_u8_array_sequence(
61        file_bits: &::wasm_bindgen::JsValue,
62        file_name: &str,
63    ) -> Result<File, JsValue>;
64    #[wasm_bindgen(catch, constructor, js_class = "File")]
65    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
66    #[doc = ""]
67    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `File`*"]
70    pub fn new_with_blob_sequence(
71        file_bits: &::wasm_bindgen::JsValue,
72        file_name: &str,
73    ) -> Result<File, JsValue>;
74    #[wasm_bindgen(catch, constructor, js_class = "File")]
75    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
76    #[doc = ""]
77    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `File`*"]
80    pub fn new_with_str_sequence(
81        file_bits: &::wasm_bindgen::JsValue,
82        file_name: &str,
83    ) -> Result<File, JsValue>;
84    #[cfg(feature = "FilePropertyBag")]
85    #[wasm_bindgen(catch, constructor, js_class = "File")]
86    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
87    #[doc = ""]
88    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"]
91    pub fn new_with_buffer_source_sequence_and_options(
92        file_bits: &::wasm_bindgen::JsValue,
93        file_name: &str,
94        options: &FilePropertyBag,
95    ) -> Result<File, JsValue>;
96    #[cfg(feature = "FilePropertyBag")]
97    #[wasm_bindgen(catch, constructor, js_class = "File")]
98    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
99    #[doc = ""]
100    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"]
103    pub fn new_with_u8_slice_sequence_and_options(
104        file_bits: &::wasm_bindgen::JsValue,
105        file_name: &str,
106        options: &FilePropertyBag,
107    ) -> Result<File, JsValue>;
108    #[cfg(feature = "FilePropertyBag")]
109    #[wasm_bindgen(catch, constructor, js_class = "File")]
110    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"]
115    pub fn new_with_u8_array_sequence_and_options(
116        file_bits: &::wasm_bindgen::JsValue,
117        file_name: &str,
118        options: &FilePropertyBag,
119    ) -> Result<File, JsValue>;
120    #[cfg(feature = "FilePropertyBag")]
121    #[wasm_bindgen(catch, constructor, js_class = "File")]
122    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
123    #[doc = ""]
124    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
125    #[doc = ""]
126    #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"]
127    pub fn new_with_blob_sequence_and_options(
128        file_bits: &::wasm_bindgen::JsValue,
129        file_name: &str,
130        options: &FilePropertyBag,
131    ) -> Result<File, JsValue>;
132    #[cfg(feature = "FilePropertyBag")]
133    #[wasm_bindgen(catch, constructor, js_class = "File")]
134    #[doc = "The `new File(..)` constructor, creating a new instance of `File`."]
135    #[doc = ""]
136    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"]
137    #[doc = ""]
138    #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"]
139    pub fn new_with_str_sequence_and_options(
140        file_bits: &::wasm_bindgen::JsValue,
141        file_name: &str,
142        options: &FilePropertyBag,
143    ) -> Result<File, JsValue>;
144}