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