web_sys/features/
gen_FormData.rs1#![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 = "FormData",
10 typescript_type = "FormData"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `FormData` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
18 pub type FormData;
19 #[wasm_bindgen(catch, constructor, js_class = "FormData")]
20 #[doc = "The `new FormData(..)` constructor, creating a new instance of `FormData`."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
25 pub fn new() -> Result<FormData, JsValue>;
26 #[cfg(feature = "HtmlFormElement")]
27 #[wasm_bindgen(catch, constructor, js_class = "FormData")]
28 #[doc = "The `new FormData(..)` constructor, creating a new instance of `FormData`."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `FormData`, `HtmlFormElement`*"]
33 pub fn new_with_form(form: &HtmlFormElement) -> Result<FormData, JsValue>;
34 #[cfg(feature = "Blob")]
35 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "append")]
36 #[doc = "The `append()` method."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/append)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FormData`*"]
41 pub fn append_with_blob(this: &FormData, name: &str, value: &Blob) -> Result<(), JsValue>;
42 #[cfg(feature = "Blob")]
43 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "append")]
44 #[doc = "The `append()` method."]
45 #[doc = ""]
46 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/append)"]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FormData`*"]
49 pub fn append_with_blob_and_filename(
50 this: &FormData,
51 name: &str,
52 value: &Blob,
53 filename: &str,
54 ) -> Result<(), JsValue>;
55 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "append")]
56 #[doc = "The `append()` method."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/append)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
61 pub fn append_with_str(this: &FormData, name: &str, value: &str) -> Result<(), JsValue>;
62 #[wasm_bindgen(method, js_class = "FormData")]
63 #[doc = "The `delete()` method."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/delete)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
68 pub fn delete(this: &FormData, name: &str);
69 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "forEach")]
70 #[doc = "The `forEach()` method."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/forEach)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
75 pub fn for_each(this: &FormData, callback: &::js_sys::Function) -> Result<(), JsValue>;
76 #[wasm_bindgen(method, js_class = "FormData")]
77 #[doc = "The `get()` method."]
78 #[doc = ""]
79 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/get)"]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
82 pub fn get(this: &FormData, name: &str) -> ::wasm_bindgen::JsValue;
83 #[wasm_bindgen(method, js_class = "FormData", js_name = "getAll")]
84 #[doc = "The `getAll()` method."]
85 #[doc = ""]
86 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/getAll)"]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
89 pub fn get_all(this: &FormData, name: &str) -> ::js_sys::Array;
90 #[wasm_bindgen(method, js_class = "FormData")]
91 #[doc = "The `has()` method."]
92 #[doc = ""]
93 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/has)"]
94 #[doc = ""]
95 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
96 pub fn has(this: &FormData, name: &str) -> bool;
97 #[cfg(feature = "Blob")]
98 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "set")]
99 #[doc = "The `set()` method."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/set)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FormData`*"]
104 pub fn set_with_blob(this: &FormData, name: &str, value: &Blob) -> Result<(), JsValue>;
105 #[cfg(feature = "Blob")]
106 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "set")]
107 #[doc = "The `set()` method."]
108 #[doc = ""]
109 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/set)"]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `Blob`, `FormData`*"]
112 pub fn set_with_blob_and_filename(
113 this: &FormData,
114 name: &str,
115 value: &Blob,
116 filename: &str,
117 ) -> Result<(), JsValue>;
118 #[wasm_bindgen(catch, method, js_class = "FormData", js_name = "set")]
119 #[doc = "The `set()` method."]
120 #[doc = ""]
121 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/set)"]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
124 pub fn set_with_str(this: &FormData, name: &str, value: &str) -> Result<(), JsValue>;
125 #[wasm_bindgen(method, js_class = "FormData")]
126 #[doc = "The `entries()` method."]
127 #[doc = ""]
128 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries)"]
129 #[doc = ""]
130 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
131 pub fn entries(this: &FormData) -> ::js_sys::Iterator;
132 #[wasm_bindgen(method, js_class = "FormData")]
133 #[doc = "The `keys()` method."]
134 #[doc = ""]
135 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/keys)"]
136 #[doc = ""]
137 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
138 pub fn keys(this: &FormData) -> ::js_sys::Iterator;
139 #[wasm_bindgen(method, js_class = "FormData")]
140 #[doc = "The `values()` method."]
141 #[doc = ""]
142 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/values)"]
143 #[doc = ""]
144 #[doc = "*This API requires the following crate features to be activated: `FormData`*"]
145 pub fn values(this: &FormData) -> ::js_sys::Iterator;
146}