web_sys/features/
gen_History.rs1#![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 = "History",
10 typescript_type = "History"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `History` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `History`*"]
18 pub type History;
19 #[wasm_bindgen(catch, method, getter, js_class = "History", js_name = "length")]
20 #[doc = "Getter for the `length` field of this object."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/length)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `History`*"]
25 pub fn length(this: &History) -> Result<u32, JsValue>;
26 #[cfg(feature = "ScrollRestoration")]
27 #[wasm_bindgen(
28 catch,
29 method,
30 getter,
31 js_class = "History",
32 js_name = "scrollRestoration"
33 )]
34 #[doc = "Getter for the `scrollRestoration` field of this object."]
35 #[doc = ""]
36 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration)"]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `History`, `ScrollRestoration`*"]
39 pub fn scroll_restoration(this: &History) -> Result<ScrollRestoration, JsValue>;
40 #[cfg(feature = "ScrollRestoration")]
41 #[wasm_bindgen(
42 catch,
43 method,
44 setter,
45 js_class = "History",
46 js_name = "scrollRestoration"
47 )]
48 #[doc = "Setter for the `scrollRestoration` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `History`, `ScrollRestoration`*"]
53 pub fn set_scroll_restoration(this: &History, value: ScrollRestoration) -> Result<(), JsValue>;
54 #[wasm_bindgen(catch, method, getter, js_class = "History", js_name = "state")]
55 #[doc = "Getter for the `state` field of this object."]
56 #[doc = ""]
57 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/state)"]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `History`*"]
60 pub fn state(this: &History) -> Result<::wasm_bindgen::JsValue, JsValue>;
61 #[wasm_bindgen(catch, method, js_class = "History")]
62 #[doc = "The `back()` method."]
63 #[doc = ""]
64 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/back)"]
65 #[doc = ""]
66 #[doc = "*This API requires the following crate features to be activated: `History`*"]
67 pub fn back(this: &History) -> Result<(), JsValue>;
68 #[wasm_bindgen(catch, method, js_class = "History")]
69 #[doc = "The `forward()` method."]
70 #[doc = ""]
71 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/forward)"]
72 #[doc = ""]
73 #[doc = "*This API requires the following crate features to be activated: `History`*"]
74 pub fn forward(this: &History) -> Result<(), JsValue>;
75 #[wasm_bindgen(catch, method, js_class = "History")]
76 #[doc = "The `go()` method."]
77 #[doc = ""]
78 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/go)"]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `History`*"]
81 pub fn go(this: &History) -> Result<(), JsValue>;
82 #[wasm_bindgen(catch, method, js_class = "History", js_name = "go")]
83 #[doc = "The `go()` method."]
84 #[doc = ""]
85 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/go)"]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `History`*"]
88 pub fn go_with_delta(this: &History, delta: i32) -> Result<(), JsValue>;
89 #[wasm_bindgen(catch, method, js_class = "History", js_name = "pushState")]
90 #[doc = "The `pushState()` method."]
91 #[doc = ""]
92 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)"]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `History`*"]
95 pub fn push_state(
96 this: &History,
97 data: &::wasm_bindgen::JsValue,
98 title: &str,
99 ) -> Result<(), JsValue>;
100 #[wasm_bindgen(catch, method, js_class = "History", js_name = "pushState")]
101 #[doc = "The `pushState()` method."]
102 #[doc = ""]
103 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)"]
104 #[doc = ""]
105 #[doc = "*This API requires the following crate features to be activated: `History`*"]
106 pub fn push_state_with_url(
107 this: &History,
108 data: &::wasm_bindgen::JsValue,
109 title: &str,
110 url: Option<&str>,
111 ) -> Result<(), JsValue>;
112 #[wasm_bindgen(catch, method, js_class = "History", js_name = "replaceState")]
113 #[doc = "The `replaceState()` method."]
114 #[doc = ""]
115 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState)"]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `History`*"]
118 pub fn replace_state(
119 this: &History,
120 data: &::wasm_bindgen::JsValue,
121 title: &str,
122 ) -> Result<(), JsValue>;
123 #[wasm_bindgen(catch, method, js_class = "History", js_name = "replaceState")]
124 #[doc = "The `replaceState()` method."]
125 #[doc = ""]
126 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState)"]
127 #[doc = ""]
128 #[doc = "*This API requires the following crate features to be activated: `History`*"]
129 pub fn replace_state_with_url(
130 this: &History,
131 data: &::wasm_bindgen::JsValue,
132 title: &str,
133 url: Option<&str>,
134 ) -> Result<(), JsValue>;
135}