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 = Response , typescript_type = "Response")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `Response` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
14 pub type Response;
15 #[cfg(feature = "ResponseType")]
16 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = type)]
17 #[doc = "Getter for the `type` field of this object."]
18 #[doc = ""]
19 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/type)"]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `Response`, `ResponseType`*"]
22 pub fn type_(this: &Response) -> ResponseType;
23 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = url)]
24 #[doc = "Getter for the `url` field of this object."]
25 #[doc = ""]
26 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/url)"]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
29 pub fn url(this: &Response) -> String;
30 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = redirected)]
31 #[doc = "Getter for the `redirected` field of this object."]
32 #[doc = ""]
33 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected)"]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
36 pub fn redirected(this: &Response) -> bool;
37 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = status)]
38 #[doc = "Getter for the `status` field of this object."]
39 #[doc = ""]
40 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/status)"]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
43 pub fn status(this: &Response) -> u16;
44 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = ok)]
45 #[doc = "Getter for the `ok` field of this object."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/ok)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
50 pub fn ok(this: &Response) -> bool;
51 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = statusText)]
52 #[doc = "Getter for the `statusText` field of this object."]
53 #[doc = ""]
54 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText)"]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
57 pub fn status_text(this: &Response) -> String;
58 #[cfg(feature = "Headers")]
59 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = headers)]
60 #[doc = "Getter for the `headers` field of this object."]
61 #[doc = ""]
62 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/headers)"]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `Headers`, `Response`*"]
65 pub fn headers(this: &Response) -> Headers;
66 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = bodyUsed)]
67 #[doc = "Getter for the `bodyUsed` field of this object."]
68 #[doc = ""]
69 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/bodyUsed)"]
70 #[doc = ""]
71 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
72 pub fn body_used(this: &Response) -> bool;
73 #[cfg(feature = "ReadableStream")]
74 # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = body)]
75 #[doc = "Getter for the `body` field of this object."]
76 #[doc = ""]
77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/body)"]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `Response`*"]
80 pub fn body(this: &Response) -> Option<ReadableStream>;
81 #[wasm_bindgen(catch, constructor, js_class = "Response")]
82 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
83 #[doc = ""]
84 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
85 #[doc = ""]
86 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
87 pub fn new() -> Result<Response, JsValue>;
88 #[cfg(feature = "Blob")]
89 #[wasm_bindgen(catch, constructor, js_class = "Response")]
90 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
91 #[doc = ""]
92 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `Blob`, `Response`*"]
95 pub fn new_with_opt_blob(body: Option<&Blob>) -> Result<Response, JsValue>;
96 #[wasm_bindgen(catch, constructor, js_class = "Response")]
97 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
98 #[doc = ""]
99 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
100 #[doc = ""]
101 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
102 pub fn new_with_opt_buffer_source(body: Option<&::js_sys::Object>)
103 -> Result<Response, JsValue>;
104 #[wasm_bindgen(catch, constructor, js_class = "Response")]
105 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
106 #[doc = ""]
107 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
108 #[doc = ""]
109 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
110 pub fn new_with_opt_u8_array(body: Option<&mut [u8]>) -> Result<Response, JsValue>;
111 #[cfg(feature = "FormData")]
112 #[wasm_bindgen(catch, constructor, js_class = "Response")]
113 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
114 #[doc = ""]
115 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `FormData`, `Response`*"]
118 pub fn new_with_opt_form_data(body: Option<&FormData>) -> Result<Response, JsValue>;
119 #[cfg(feature = "UrlSearchParams")]
120 #[wasm_bindgen(catch, constructor, js_class = "Response")]
121 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `Response`, `UrlSearchParams`*"]
126 pub fn new_with_opt_url_search_params(
127 body: Option<&UrlSearchParams>,
128 ) -> Result<Response, JsValue>;
129 #[wasm_bindgen(catch, constructor, js_class = "Response")]
130 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
131 #[doc = ""]
132 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
133 #[doc = ""]
134 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
135 pub fn new_with_opt_str(body: Option<&str>) -> Result<Response, JsValue>;
136 #[cfg(feature = "ReadableStream")]
137 #[wasm_bindgen(catch, constructor, js_class = "Response")]
138 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
139 #[doc = ""]
140 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
141 #[doc = ""]
142 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `Response`*"]
143 pub fn new_with_opt_readable_stream(body: Option<&ReadableStream>)
144 -> Result<Response, JsValue>;
145 #[cfg(all(feature = "Blob", feature = "ResponseInit",))]
146 #[wasm_bindgen(catch, constructor, js_class = "Response")]
147 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
148 #[doc = ""]
149 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
150 #[doc = ""]
151 #[doc = "*This API requires the following crate features to be activated: `Blob`, `Response`, `ResponseInit`*"]
152 pub fn new_with_opt_blob_and_init(
153 body: Option<&Blob>,
154 init: &ResponseInit,
155 ) -> Result<Response, JsValue>;
156 #[cfg(feature = "ResponseInit")]
157 #[wasm_bindgen(catch, constructor, js_class = "Response")]
158 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
159 #[doc = ""]
160 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
161 #[doc = ""]
162 #[doc = "*This API requires the following crate features to be activated: `Response`, `ResponseInit`*"]
163 pub fn new_with_opt_buffer_source_and_init(
164 body: Option<&::js_sys::Object>,
165 init: &ResponseInit,
166 ) -> Result<Response, JsValue>;
167 #[cfg(feature = "ResponseInit")]
168 #[wasm_bindgen(catch, constructor, js_class = "Response")]
169 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
170 #[doc = ""]
171 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
172 #[doc = ""]
173 #[doc = "*This API requires the following crate features to be activated: `Response`, `ResponseInit`*"]
174 pub fn new_with_opt_u8_array_and_init(
175 body: Option<&mut [u8]>,
176 init: &ResponseInit,
177 ) -> Result<Response, JsValue>;
178 #[cfg(all(feature = "FormData", feature = "ResponseInit",))]
179 #[wasm_bindgen(catch, constructor, js_class = "Response")]
180 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
181 #[doc = ""]
182 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
183 #[doc = ""]
184 #[doc = "*This API requires the following crate features to be activated: `FormData`, `Response`, `ResponseInit`*"]
185 pub fn new_with_opt_form_data_and_init(
186 body: Option<&FormData>,
187 init: &ResponseInit,
188 ) -> Result<Response, JsValue>;
189 #[cfg(all(feature = "ResponseInit", feature = "UrlSearchParams",))]
190 #[wasm_bindgen(catch, constructor, js_class = "Response")]
191 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
192 #[doc = ""]
193 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
194 #[doc = ""]
195 #[doc = "*This API requires the following crate features to be activated: `Response`, `ResponseInit`, `UrlSearchParams`*"]
196 pub fn new_with_opt_url_search_params_and_init(
197 body: Option<&UrlSearchParams>,
198 init: &ResponseInit,
199 ) -> Result<Response, JsValue>;
200 #[cfg(feature = "ResponseInit")]
201 #[wasm_bindgen(catch, constructor, js_class = "Response")]
202 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
203 #[doc = ""]
204 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
205 #[doc = ""]
206 #[doc = "*This API requires the following crate features to be activated: `Response`, `ResponseInit`*"]
207 pub fn new_with_opt_str_and_init(
208 body: Option<&str>,
209 init: &ResponseInit,
210 ) -> Result<Response, JsValue>;
211 #[cfg(all(feature = "ReadableStream", feature = "ResponseInit",))]
212 #[wasm_bindgen(catch, constructor, js_class = "Response")]
213 #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."]
214 #[doc = ""]
215 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"]
216 #[doc = ""]
217 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `Response`, `ResponseInit`*"]
218 pub fn new_with_opt_readable_stream_and_init(
219 body: Option<&ReadableStream>,
220 init: &ResponseInit,
221 ) -> Result<Response, JsValue>;
222 # [wasm_bindgen (catch , method , structural , js_class = "Response" , js_name = clone)]
223 #[doc = "The `clone()` method."]
224 #[doc = ""]
225 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/clone)"]
226 #[doc = ""]
227 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
228 pub fn clone(this: &Response) -> Result<Response, JsValue>;
229 # [wasm_bindgen (static_method_of = Response , js_class = "Response" , js_name = error)]
230 #[doc = "The `error()` method."]
231 #[doc = ""]
232 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/error)"]
233 #[doc = ""]
234 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
235 pub fn error() -> Response;
236 # [wasm_bindgen (catch , static_method_of = Response , js_class = "Response" , js_name = redirect)]
237 #[doc = "The `redirect()` method."]
238 #[doc = ""]
239 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect)"]
240 #[doc = ""]
241 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
242 pub fn redirect(url: &str) -> Result<Response, JsValue>;
243 # [wasm_bindgen (catch , static_method_of = Response , js_class = "Response" , js_name = redirect)]
244 #[doc = "The `redirect()` method."]
245 #[doc = ""]
246 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect)"]
247 #[doc = ""]
248 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
249 pub fn redirect_with_status(url: &str, status: u16) -> Result<Response, JsValue>;
250 # [wasm_bindgen (catch , method , structural , js_class = "Response" , js_name = arrayBuffer)]
251 #[doc = "The `arrayBuffer()` method."]
252 #[doc = ""]
253 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/arrayBuffer)"]
254 #[doc = ""]
255 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
256 pub fn array_buffer(this: &Response) -> Result<::js_sys::Promise, JsValue>;
257 # [wasm_bindgen (catch , method , structural , js_class = "Response" , js_name = blob)]
258 #[doc = "The `blob()` method."]
259 #[doc = ""]
260 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/blob)"]
261 #[doc = ""]
262 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
263 pub fn blob(this: &Response) -> Result<::js_sys::Promise, JsValue>;
264 # [wasm_bindgen (catch , method , structural , js_class = "Response" , js_name = formData)]
265 #[doc = "The `formData()` method."]
266 #[doc = ""]
267 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/formData)"]
268 #[doc = ""]
269 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
270 pub fn form_data(this: &Response) -> Result<::js_sys::Promise, JsValue>;
271 # [wasm_bindgen (catch , method , structural , js_class = "Response" , js_name = json)]
272 #[doc = "The `json()` method."]
273 #[doc = ""]
274 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/json)"]
275 #[doc = ""]
276 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
277 pub fn json(this: &Response) -> Result<::js_sys::Promise, JsValue>;
278 # [wasm_bindgen (catch , method , structural , js_class = "Response" , js_name = text)]
279 #[doc = "The `text()` method."]
280 #[doc = ""]
281 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/text)"]
282 #[doc = ""]
283 #[doc = "*This API requires the following crate features to be activated: `Response`*"]
284 pub fn text(this: &Response) -> Result<::js_sys::Promise, JsValue>;
285}
286