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 = URL , typescript_type = "URL")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `Url` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
14 pub type Url;
15 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = href)]
16 #[doc = "Getter for the `href` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/href)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
21 pub fn href(this: &Url) -> ::alloc::string::String;
22 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = href)]
23 #[doc = "Setter for the `href` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/href)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
28 pub fn set_href(this: &Url, value: &str);
29 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = origin)]
30 #[doc = "Getter for the `origin` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
35 pub fn origin(this: &Url) -> ::alloc::string::String;
36 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = protocol)]
37 #[doc = "Getter for the `protocol` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
42 pub fn protocol(this: &Url) -> ::alloc::string::String;
43 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = protocol)]
44 #[doc = "Setter for the `protocol` field of this object."]
45 #[doc = ""]
46 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol)"]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
49 pub fn set_protocol(this: &Url, value: &str);
50 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = username)]
51 #[doc = "Getter for the `username` field of this object."]
52 #[doc = ""]
53 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/username)"]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
56 pub fn username(this: &Url) -> ::alloc::string::String;
57 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = username)]
58 #[doc = "Setter for the `username` field of this object."]
59 #[doc = ""]
60 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/username)"]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
63 pub fn set_username(this: &Url, value: &str);
64 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = password)]
65 #[doc = "Getter for the `password` field of this object."]
66 #[doc = ""]
67 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/password)"]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
70 pub fn password(this: &Url) -> ::alloc::string::String;
71 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = password)]
72 #[doc = "Setter for the `password` field of this object."]
73 #[doc = ""]
74 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/password)"]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
77 pub fn set_password(this: &Url, value: &str);
78 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = host)]
79 #[doc = "Getter for the `host` field of this object."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/host)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
84 pub fn host(this: &Url) -> ::alloc::string::String;
85 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = host)]
86 #[doc = "Setter for the `host` field of this object."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/host)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
91 pub fn set_host(this: &Url, value: &str);
92 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = hostname)]
93 #[doc = "Getter for the `hostname` field of this object."]
94 #[doc = ""]
95 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/hostname)"]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
98 pub fn hostname(this: &Url) -> ::alloc::string::String;
99 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = hostname)]
100 #[doc = "Setter for the `hostname` field of this object."]
101 #[doc = ""]
102 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/hostname)"]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
105 pub fn set_hostname(this: &Url, value: &str);
106 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = port)]
107 #[doc = "Getter for the `port` field of this object."]
108 #[doc = ""]
109 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/port)"]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
112 pub fn port(this: &Url) -> ::alloc::string::String;
113 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = port)]
114 #[doc = "Setter for the `port` field of this object."]
115 #[doc = ""]
116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/port)"]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
119 pub fn set_port(this: &Url, value: &str);
120 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = pathname)]
121 #[doc = "Getter for the `pathname` field of this object."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
126 pub fn pathname(this: &Url) -> ::alloc::string::String;
127 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = pathname)]
128 #[doc = "Setter for the `pathname` field of this object."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
133 pub fn set_pathname(this: &Url, value: &str);
134 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = search)]
135 #[doc = "Getter for the `search` field of this object."]
136 #[doc = ""]
137 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/search)"]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
140 pub fn search(this: &Url) -> ::alloc::string::String;
141 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = search)]
142 #[doc = "Setter for the `search` field of this object."]
143 #[doc = ""]
144 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/search)"]
145 #[doc = ""]
146 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
147 pub fn set_search(this: &Url, value: &str);
148 #[cfg(feature = "UrlSearchParams")]
149 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = searchParams)]
150 #[doc = "Getter for the `searchParams` field of this object."]
151 #[doc = ""]
152 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams)"]
153 #[doc = ""]
154 #[doc = "*This API requires the following crate features to be activated: `Url`, `UrlSearchParams`*"]
155 pub fn search_params(this: &Url) -> UrlSearchParams;
156 # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = hash)]
157 #[doc = "Getter for the `hash` field of this object."]
158 #[doc = ""]
159 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash)"]
160 #[doc = ""]
161 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
162 pub fn hash(this: &Url) -> ::alloc::string::String;
163 # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = hash)]
164 #[doc = "Setter for the `hash` field of this object."]
165 #[doc = ""]
166 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash)"]
167 #[doc = ""]
168 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
169 pub fn set_hash(this: &Url, value: &str);
170 #[wasm_bindgen(catch, constructor, js_class = "URL")]
171 #[doc = "The `new Url(..)` constructor, creating a new instance of `Url`."]
172 #[doc = ""]
173 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)"]
174 #[doc = ""]
175 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
176 pub fn new(url: &str) -> Result<Url, JsValue>;
177 #[wasm_bindgen(catch, constructor, js_class = "URL")]
178 #[doc = "The `new Url(..)` constructor, creating a new instance of `Url`."]
179 #[doc = ""]
180 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)"]
181 #[doc = ""]
182 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
183 pub fn new_with_base(url: &str, base: &str) -> Result<Url, JsValue>;
184 #[cfg(feature = "Blob")]
185 # [wasm_bindgen (catch , static_method_of = Url , js_class = "URL" , js_name = createObjectURL)]
186 #[doc = "The `createObjectURL()` method."]
187 #[doc = ""]
188 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static)"]
189 #[doc = ""]
190 #[doc = "*This API requires the following crate features to be activated: `Blob`, `Url`*"]
191 pub fn create_object_url_with_blob(blob: &Blob) -> Result<::alloc::string::String, JsValue>;
192 #[cfg(feature = "MediaSource")]
193 # [wasm_bindgen (catch , static_method_of = Url , js_class = "URL" , js_name = createObjectURL)]
194 #[doc = "The `createObjectURL()` method."]
195 #[doc = ""]
196 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static)"]
197 #[doc = ""]
198 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `Url`*"]
199 pub fn create_object_url_with_source(
200 source: &MediaSource,
201 ) -> Result<::alloc::string::String, JsValue>;
202 # [wasm_bindgen (catch , static_method_of = Url , js_class = "URL" , js_name = revokeObjectURL)]
203 #[doc = "The `revokeObjectURL()` method."]
204 #[doc = ""]
205 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL_static)"]
206 #[doc = ""]
207 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
208 pub fn revoke_object_url(url: &str) -> Result<(), JsValue>;
209 # [wasm_bindgen (method , structural , js_class = "URL" , js_name = toJSON)]
210 #[doc = "The `toJSON()` method."]
211 #[doc = ""]
212 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/toJSON)"]
213 #[doc = ""]
214 #[doc = "*This API requires the following crate features to be activated: `Url`*"]
215 pub fn to_json(this: &Url) -> ::alloc::string::String;
216}