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