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