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
use super::*;
/// The Navigation class.
/// [`Navigation`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct Navigation {
inner: EventTarget,
}
impl FromVal for Navigation {
fn from_val(v: &Any) -> Self {
Navigation {
inner: EventTarget::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for Navigation {
type Target = EventTarget;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for Navigation {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for Navigation {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for Navigation {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<Navigation> for Any {
fn from(s: Navigation) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&Navigation> for Any {
fn from(s: &Navigation) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(Navigation);
impl Navigation {
/// Getter of the `currentEntry` attribute.
/// [`Navigation.currentEntry`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/currentEntry)
pub fn current_entry(&self) -> NavigationHistoryEntry {
self.inner
.get("currentEntry")
.as_::<NavigationHistoryEntry>()
}
}
impl Navigation {
/// Getter of the `transition` attribute.
/// [`Navigation.transition`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/transition)
pub fn transition(&self) -> NavigationTransition {
self.inner.get("transition").as_::<NavigationTransition>()
}
}
impl Navigation {
/// Getter of the `activation` attribute.
/// [`Navigation.activation`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/activation)
pub fn activation(&self) -> NavigationActivation {
self.inner.get("activation").as_::<NavigationActivation>()
}
}
impl Navigation {
/// Getter of the `canGoBack` attribute.
/// [`Navigation.canGoBack`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/canGoBack)
pub fn can_go_back(&self) -> bool {
self.inner.get("canGoBack").as_::<bool>()
}
}
impl Navigation {
/// Getter of the `canGoForward` attribute.
/// [`Navigation.canGoForward`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/canGoForward)
pub fn can_go_forward(&self) -> bool {
self.inner.get("canGoForward").as_::<bool>()
}
}
impl Navigation {
/// Getter of the `onnavigate` attribute.
/// [`Navigation.onnavigate`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/onnavigate)
pub fn onnavigate(&self) -> Any {
self.inner.get("onnavigate").as_::<Any>()
}
/// Setter of the `onnavigate` attribute.
/// [`Navigation.onnavigate`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/onnavigate)
pub fn set_onnavigate(&mut self, value: &Any) {
self.inner.set("onnavigate", value);
}
}
impl Navigation {
/// Getter of the `onnavigatesuccess` attribute.
/// [`Navigation.onnavigatesuccess`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/onnavigatesuccess)
pub fn onnavigatesuccess(&self) -> Any {
self.inner.get("onnavigatesuccess").as_::<Any>()
}
/// Setter of the `onnavigatesuccess` attribute.
/// [`Navigation.onnavigatesuccess`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/onnavigatesuccess)
pub fn set_onnavigatesuccess(&mut self, value: &Any) {
self.inner.set("onnavigatesuccess", value);
}
}
impl Navigation {
/// Getter of the `onnavigateerror` attribute.
/// [`Navigation.onnavigateerror`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/onnavigateerror)
pub fn onnavigateerror(&self) -> Any {
self.inner.get("onnavigateerror").as_::<Any>()
}
/// Setter of the `onnavigateerror` attribute.
/// [`Navigation.onnavigateerror`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/onnavigateerror)
pub fn set_onnavigateerror(&mut self, value: &Any) {
self.inner.set("onnavigateerror", value);
}
}
impl Navigation {
/// Getter of the `oncurrententrychange` attribute.
/// [`Navigation.oncurrententrychange`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/oncurrententrychange)
pub fn oncurrententrychange(&self) -> Any {
self.inner.get("oncurrententrychange").as_::<Any>()
}
/// Setter of the `oncurrententrychange` attribute.
/// [`Navigation.oncurrententrychange`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/oncurrententrychange)
pub fn set_oncurrententrychange(&mut self, value: &Any) {
self.inner.set("oncurrententrychange", value);
}
}
impl Navigation {
/// The entries method.
/// [`Navigation.entries`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/entries)
pub fn entries(&self) -> TypedArray<NavigationHistoryEntry> {
self.inner
.call("entries", &[])
.as_::<TypedArray<NavigationHistoryEntry>>()
}
}
impl Navigation {
/// The updateCurrentEntry method.
/// [`Navigation.updateCurrentEntry`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/updateCurrentEntry)
pub fn update_current_entry(&self, options: &NavigationUpdateCurrentEntryOptions) -> Undefined {
self.inner
.call("updateCurrentEntry", &[options.into()])
.as_::<Undefined>()
}
}
impl Navigation {
/// The navigate method.
/// [`Navigation.navigate`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate)
pub fn navigate(&self, url: &JsString) -> NavigationResult {
self.inner
.call("navigate", &[url.into()])
.as_::<NavigationResult>()
}
}
impl Navigation {
/// The navigate method.
/// [`Navigation.navigate`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate)
pub fn navigate_with_options(
&self,
url: &JsString,
options: &NavigationNavigateOptions,
) -> NavigationResult {
self.inner
.call("navigate", &[url.into(), options.into()])
.as_::<NavigationResult>()
}
}
impl Navigation {
/// The reload method.
/// [`Navigation.reload`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/reload)
pub fn reload(&self) -> NavigationResult {
self.inner.call("reload", &[]).as_::<NavigationResult>()
}
}
impl Navigation {
/// The reload method.
/// [`Navigation.reload`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/reload)
pub fn reload_with_options(&self, options: &NavigationReloadOptions) -> NavigationResult {
self.inner
.call("reload", &[options.into()])
.as_::<NavigationResult>()
}
}
impl Navigation {
/// The traverseTo method.
/// [`Navigation.traverseTo`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/traverseTo)
pub fn traverse_to(&self, key: &JsString) -> NavigationResult {
self.inner
.call("traverseTo", &[key.into()])
.as_::<NavigationResult>()
}
}
impl Navigation {
/// The traverseTo method.
/// [`Navigation.traverseTo`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/traverseTo)
pub fn traverse_to_with_options(
&self,
key: &JsString,
options: &NavigationOptions,
) -> NavigationResult {
self.inner
.call("traverseTo", &[key.into(), options.into()])
.as_::<NavigationResult>()
}
}
impl Navigation {
/// The back method.
/// [`Navigation.back`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/back)
pub fn back(&self) -> NavigationResult {
self.inner.call("back", &[]).as_::<NavigationResult>()
}
}
impl Navigation {
/// The back method.
/// [`Navigation.back`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/back)
pub fn back_with_options(&self, options: &NavigationOptions) -> NavigationResult {
self.inner
.call("back", &[options.into()])
.as_::<NavigationResult>()
}
}
impl Navigation {
/// The forward method.
/// [`Navigation.forward`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/forward)
pub fn forward(&self) -> NavigationResult {
self.inner.call("forward", &[]).as_::<NavigationResult>()
}
}
impl Navigation {
/// The forward method.
/// [`Navigation.forward`](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/forward)
pub fn forward_with_options(&self, options: &NavigationOptions) -> NavigationResult {
self.inner
.call("forward", &[options.into()])
.as_::<NavigationResult>()
}
}