1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
#![allow(unused_imports)]
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
    # [wasm_bindgen (extends = XmlHttpRequestEventTarget , extends = EventTarget , extends = :: js_sys :: Object , js_name = XMLHttpRequest , typescript_type = "XMLHttpRequest")]
    #[derive(Debug, Clone, PartialEq, Eq)]
    #[doc = "The `XmlHttpRequest` class."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub type XmlHttpRequest;
    # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = onreadystatechange)]
    #[doc = "Getter for the `onreadystatechange` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/onreadystatechange)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn onreadystatechange(this: &XmlHttpRequest) -> Option<::js_sys::Function>;
    # [wasm_bindgen (structural , method , setter , js_class = "XMLHttpRequest" , js_name = onreadystatechange)]
    #[doc = "Setter for the `onreadystatechange` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/onreadystatechange)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn set_onreadystatechange(this: &XmlHttpRequest, value: Option<&::js_sys::Function>);
    # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = readyState)]
    #[doc = "Getter for the `readyState` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn ready_state(this: &XmlHttpRequest) -> u16;
    # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = timeout)]
    #[doc = "Getter for the `timeout` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn timeout(this: &XmlHttpRequest) -> u32;
    # [wasm_bindgen (structural , method , setter , js_class = "XMLHttpRequest" , js_name = timeout)]
    #[doc = "Setter for the `timeout` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn set_timeout(this: &XmlHttpRequest, value: u32);
    # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = withCredentials)]
    #[doc = "Getter for the `withCredentials` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn with_credentials(this: &XmlHttpRequest) -> bool;
    # [wasm_bindgen (structural , method , setter , js_class = "XMLHttpRequest" , js_name = withCredentials)]
    #[doc = "Setter for the `withCredentials` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn set_with_credentials(this: &XmlHttpRequest, value: bool);
    #[cfg(feature = "XmlHttpRequestUpload")]
    # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = upload)]
    #[doc = "Getter for the `upload` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/upload)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`, `XmlHttpRequestUpload`*"]
    pub fn upload(this: &XmlHttpRequest) -> Result<XmlHttpRequestUpload, JsValue>;
    # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = responseURL)]
    #[doc = "Getter for the `responseURL` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn response_url(this: &XmlHttpRequest) -> String;
    # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = status)]
    #[doc = "Getter for the `status` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/status)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn status(this: &XmlHttpRequest) -> Result<u16, JsValue>;
    # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = statusText)]
    #[doc = "Getter for the `statusText` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/statusText)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn status_text(this: &XmlHttpRequest) -> Result<String, JsValue>;
    #[cfg(feature = "XmlHttpRequestResponseType")]
    # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = responseType)]
    #[doc = "Getter for the `responseType` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`, `XmlHttpRequestResponseType`*"]
    pub fn response_type(this: &XmlHttpRequest) -> XmlHttpRequestResponseType;
    #[cfg(feature = "XmlHttpRequestResponseType")]
    # [wasm_bindgen (structural , method , setter , js_class = "XMLHttpRequest" , js_name = responseType)]
    #[doc = "Setter for the `responseType` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`, `XmlHttpRequestResponseType`*"]
    pub fn set_response_type(this: &XmlHttpRequest, value: XmlHttpRequestResponseType);
    # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = response)]
    #[doc = "Getter for the `response` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/response)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn response(this: &XmlHttpRequest) -> Result<::wasm_bindgen::JsValue, JsValue>;
    # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = responseText)]
    #[doc = "Getter for the `responseText` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseText)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn response_text(this: &XmlHttpRequest) -> Result<Option<String>, JsValue>;
    #[cfg(feature = "Document")]
    # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = responseXML)]
    #[doc = "Getter for the `responseXML` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `Document`, `XmlHttpRequest`*"]
    pub fn response_xml(this: &XmlHttpRequest) -> Result<Option<Document>, JsValue>;
    #[wasm_bindgen(catch, constructor, js_class = "XMLHttpRequest")]
    #[doc = "The `new XmlHttpRequest(..)` constructor, creating a new instance of `XmlHttpRequest`."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/XMLHttpRequest)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn new() -> Result<XmlHttpRequest, JsValue>;
    #[wasm_bindgen(catch, constructor, js_class = "XMLHttpRequest")]
    #[doc = "The `new XmlHttpRequest(..)` constructor, creating a new instance of `XmlHttpRequest`."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/XMLHttpRequest)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn new_with_ignored(ignored: &str) -> Result<XmlHttpRequest, JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = abort)]
    #[doc = "The `abort()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/abort)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn abort(this: &XmlHttpRequest) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = getAllResponseHeaders)]
    #[doc = "The `getAllResponseHeaders()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn get_all_response_headers(this: &XmlHttpRequest) -> Result<String, JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = getResponseHeader)]
    #[doc = "The `getResponseHeader()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getResponseHeader)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn get_response_header(
        this: &XmlHttpRequest,
        header: &str,
    ) -> Result<Option<String>, JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = open)]
    #[doc = "The `open()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn open(this: &XmlHttpRequest, method: &str, url: &str) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = open)]
    #[doc = "The `open()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn open_with_async(
        this: &XmlHttpRequest,
        method: &str,
        url: &str,
        r#async: bool,
    ) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = open)]
    #[doc = "The `open()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn open_with_async_and_user(
        this: &XmlHttpRequest,
        method: &str,
        url: &str,
        r#async: bool,
        user: Option<&str>,
    ) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = open)]
    #[doc = "The `open()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn open_with_async_and_user_and_password(
        this: &XmlHttpRequest,
        method: &str,
        url: &str,
        r#async: bool,
        user: Option<&str>,
        password: Option<&str>,
    ) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = overrideMimeType)]
    #[doc = "The `overrideMimeType()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/overrideMimeType)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn override_mime_type(this: &XmlHttpRequest, mime: &str) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn send(this: &XmlHttpRequest) -> Result<(), JsValue>;
    #[cfg(feature = "Document")]
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `Document`, `XmlHttpRequest`*"]
    pub fn send_with_opt_document(
        this: &XmlHttpRequest,
        body: Option<&Document>,
    ) -> Result<(), JsValue>;
    #[cfg(feature = "Blob")]
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `Blob`, `XmlHttpRequest`*"]
    pub fn send_with_opt_blob(this: &XmlHttpRequest, body: Option<&Blob>) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn send_with_opt_buffer_source(
        this: &XmlHttpRequest,
        body: Option<&::js_sys::Object>,
    ) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn send_with_opt_u8_array(
        this: &XmlHttpRequest,
        body: Option<&[u8]>,
    ) -> Result<(), JsValue>;
    #[cfg(feature = "FormData")]
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `FormData`, `XmlHttpRequest`*"]
    pub fn send_with_opt_form_data(
        this: &XmlHttpRequest,
        body: Option<&FormData>,
    ) -> Result<(), JsValue>;
    #[cfg(feature = "UrlSearchParams")]
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`, `XmlHttpRequest`*"]
    pub fn send_with_opt_url_search_params(
        this: &XmlHttpRequest,
        body: Option<&UrlSearchParams>,
    ) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn send_with_opt_str(this: &XmlHttpRequest, body: Option<&str>) -> Result<(), JsValue>;
    #[cfg(feature = "ReadableStream")]
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)]
    #[doc = "The `send()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `XmlHttpRequest`*"]
    pub fn send_with_opt_readable_stream(
        this: &XmlHttpRequest,
        body: Option<&ReadableStream>,
    ) -> Result<(), JsValue>;
    # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = setRequestHeader)]
    #[doc = "The `setRequestHeader()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub fn set_request_header(
        this: &XmlHttpRequest,
        header: &str,
        value: &str,
    ) -> Result<(), JsValue>;
}
impl XmlHttpRequest {
    #[doc = "The `XMLHttpRequest.UNSENT` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub const UNSENT: u16 = 0i64 as u16;
    #[doc = "The `XMLHttpRequest.OPENED` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub const OPENED: u16 = 1u64 as u16;
    #[doc = "The `XMLHttpRequest.HEADERS_RECEIVED` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub const HEADERS_RECEIVED: u16 = 2u64 as u16;
    #[doc = "The `XMLHttpRequest.LOADING` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub const LOADING: u16 = 3u64 as u16;
    #[doc = "The `XMLHttpRequest.DONE` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"]
    pub const DONE: u16 = 4u64 as u16;
}