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 = Request , typescript_type = "Request")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `Request` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
14 pub type Request;
15 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = method)]
16 #[doc = "Getter for the `method` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/method)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
21 pub fn method(this: &Request) -> String;
22 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = url)]
23 #[doc = "Getter for the `url` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/url)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
28 pub fn url(this: &Request) -> String;
29 #[cfg(feature = "Headers")]
30 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = headers)]
31 #[doc = "Getter for the `headers` field of this object."]
32 #[doc = ""]
33 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/headers)"]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `Headers`, `Request`*"]
36 pub fn headers(this: &Request) -> Headers;
37 #[cfg(feature = "RequestDestination")]
38 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = destination)]
39 #[doc = "Getter for the `destination` field of this object."]
40 #[doc = ""]
41 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/destination)"]
42 #[doc = ""]
43 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestDestination`*"]
44 pub fn destination(this: &Request) -> RequestDestination;
45 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = referrer)]
46 #[doc = "Getter for the `referrer` field of this object."]
47 #[doc = ""]
48 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/referrer)"]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
51 pub fn referrer(this: &Request) -> String;
52 #[cfg(feature = "ReferrerPolicy")]
53 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = referrerPolicy)]
54 #[doc = "Getter for the `referrerPolicy` field of this object."]
55 #[doc = ""]
56 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy)"]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `ReferrerPolicy`, `Request`*"]
59 pub fn referrer_policy(this: &Request) -> ReferrerPolicy;
60 #[cfg(feature = "RequestMode")]
61 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = mode)]
62 #[doc = "Getter for the `mode` field of this object."]
63 #[doc = ""]
64 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/mode)"]
65 #[doc = ""]
66 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestMode`*"]
67 pub fn mode(this: &Request) -> RequestMode;
68 #[cfg(feature = "RequestCredentials")]
69 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = credentials)]
70 #[doc = "Getter for the `credentials` field of this object."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestCredentials`*"]
75 pub fn credentials(this: &Request) -> RequestCredentials;
76 #[cfg(feature = "RequestCache")]
77 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = cache)]
78 #[doc = "Getter for the `cache` field of this object."]
79 #[doc = ""]
80 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/cache)"]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestCache`*"]
83 pub fn cache(this: &Request) -> RequestCache;
84 #[cfg(feature = "RequestRedirect")]
85 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = redirect)]
86 #[doc = "Getter for the `redirect` field of this object."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/redirect)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestRedirect`*"]
91 pub fn redirect(this: &Request) -> RequestRedirect;
92 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = integrity)]
93 #[doc = "Getter for the `integrity` field of this object."]
94 #[doc = ""]
95 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity)"]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
98 pub fn integrity(this: &Request) -> String;
99 #[cfg(feature = "AbortSignal")]
100 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = signal)]
101 #[doc = "Getter for the `signal` field of this object."]
102 #[doc = ""]
103 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/signal)"]
104 #[doc = ""]
105 #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `Request`*"]
106 pub fn signal(this: &Request) -> AbortSignal;
107 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = bodyUsed)]
108 #[doc = "Getter for the `bodyUsed` field of this object."]
109 #[doc = ""]
110 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/bodyUsed)"]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
113 pub fn body_used(this: &Request) -> bool;
114 #[cfg(feature = "ReadableStream")]
115 # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = body)]
116 #[doc = "Getter for the `body` field of this object."]
117 #[doc = ""]
118 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/body)"]
119 #[doc = ""]
120 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `Request`*"]
121 pub fn body(this: &Request) -> Option<ReadableStream>;
122 #[wasm_bindgen(catch, constructor, js_class = "Request")]
123 #[doc = "The `new Request(..)` constructor, creating a new instance of `Request`."]
124 #[doc = ""]
125 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)"]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
128 pub fn new_with_request(input: &Request) -> Result<Request, JsValue>;
129 #[wasm_bindgen(catch, constructor, js_class = "Request")]
130 #[doc = "The `new Request(..)` constructor, creating a new instance of `Request`."]
131 #[doc = ""]
132 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)"]
133 #[doc = ""]
134 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
135 pub fn new_with_str(input: &str) -> Result<Request, JsValue>;
136 #[cfg(feature = "RequestInit")]
137 #[wasm_bindgen(catch, constructor, js_class = "Request")]
138 #[doc = "The `new Request(..)` constructor, creating a new instance of `Request`."]
139 #[doc = ""]
140 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)"]
141 #[doc = ""]
142 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestInit`*"]
143 pub fn new_with_request_and_init(
144 input: &Request,
145 init: &RequestInit,
146 ) -> Result<Request, JsValue>;
147 #[cfg(feature = "RequestInit")]
148 #[wasm_bindgen(catch, constructor, js_class = "Request")]
149 #[doc = "The `new Request(..)` constructor, creating a new instance of `Request`."]
150 #[doc = ""]
151 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request)"]
152 #[doc = ""]
153 #[doc = "*This API requires the following crate features to be activated: `Request`, `RequestInit`*"]
154 pub fn new_with_str_and_init(input: &str, init: &RequestInit) -> Result<Request, JsValue>;
155 # [wasm_bindgen (catch , method , structural , js_class = "Request" , js_name = clone)]
156 #[doc = "The `clone()` method."]
157 #[doc = ""]
158 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/clone)"]
159 #[doc = ""]
160 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
161 pub fn clone(this: &Request) -> Result<Request, JsValue>;
162 # [wasm_bindgen (catch , method , structural , js_class = "Request" , js_name = arrayBuffer)]
163 #[doc = "The `arrayBuffer()` method."]
164 #[doc = ""]
165 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/arrayBuffer)"]
166 #[doc = ""]
167 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
168 pub fn array_buffer(this: &Request) -> Result<::js_sys::Promise, JsValue>;
169 # [wasm_bindgen (catch , method , structural , js_class = "Request" , js_name = blob)]
170 #[doc = "The `blob()` method."]
171 #[doc = ""]
172 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/blob)"]
173 #[doc = ""]
174 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
175 pub fn blob(this: &Request) -> Result<::js_sys::Promise, JsValue>;
176 # [wasm_bindgen (catch , method , structural , js_class = "Request" , js_name = formData)]
177 #[doc = "The `formData()` method."]
178 #[doc = ""]
179 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/formData)"]
180 #[doc = ""]
181 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
182 pub fn form_data(this: &Request) -> Result<::js_sys::Promise, JsValue>;
183 # [wasm_bindgen (catch , method , structural , js_class = "Request" , js_name = json)]
184 #[doc = "The `json()` method."]
185 #[doc = ""]
186 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/json)"]
187 #[doc = ""]
188 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
189 pub fn json(this: &Request) -> Result<::js_sys::Promise, JsValue>;
190 # [wasm_bindgen (catch , method , structural , js_class = "Request" , js_name = text)]
191 #[doc = "The `text()` method."]
192 #[doc = ""]
193 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/text)"]
194 #[doc = ""]
195 #[doc = "*This API requires the following crate features to be activated: `Request`*"]
196 pub fn text(this: &Request) -> Result<::js_sys::Promise, JsValue>;
197}
198