Skip to main content

web_sys/features/
gen_NavigationInterceptOptions.rs

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 = "NavigationInterceptOptions")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `NavigationInterceptOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `NavigationInterceptOptions`*"]
12    pub type NavigationInterceptOptions;
13    #[cfg(feature = "NavigationFocusReset")]
14    #[doc = "Get the `focusReset` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `NavigationFocusReset`, `NavigationInterceptOptions`*"]
17    #[wasm_bindgen(method, getter = "focusReset")]
18    pub fn get_focus_reset(this: &NavigationInterceptOptions) -> Option<NavigationFocusReset>;
19    #[cfg(feature = "NavigationFocusReset")]
20    #[doc = "Change the `focusReset` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `NavigationFocusReset`, `NavigationInterceptOptions`*"]
23    #[wasm_bindgen(method, setter = "focusReset")]
24    pub fn set_focus_reset(this: &NavigationInterceptOptions, val: NavigationFocusReset);
25    #[doc = "Get the `handler` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `NavigationInterceptOptions`*"]
28    #[wasm_bindgen(method, getter = "handler")]
29    pub fn get_handler(this: &NavigationInterceptOptions) -> Option<::js_sys::Function>;
30    #[doc = "Change the `handler` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `NavigationInterceptOptions`*"]
33    #[wasm_bindgen(method, setter = "handler")]
34    pub fn set_handler(this: &NavigationInterceptOptions, val: &::js_sys::Function);
35    #[cfg(feature = "NavigationScrollBehavior")]
36    #[doc = "Get the `scroll` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `NavigationInterceptOptions`, `NavigationScrollBehavior`*"]
39    #[wasm_bindgen(method, getter = "scroll")]
40    pub fn get_scroll(this: &NavigationInterceptOptions) -> Option<NavigationScrollBehavior>;
41    #[cfg(feature = "NavigationScrollBehavior")]
42    #[doc = "Change the `scroll` field of this object."]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `NavigationInterceptOptions`, `NavigationScrollBehavior`*"]
45    #[wasm_bindgen(method, setter = "scroll")]
46    pub fn set_scroll(this: &NavigationInterceptOptions, val: NavigationScrollBehavior);
47}
48impl NavigationInterceptOptions {
49    #[doc = "Construct a new `NavigationInterceptOptions`."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `NavigationInterceptOptions`*"]
52    pub fn new() -> Self {
53        #[allow(unused_mut)]
54        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
55        ret
56    }
57    #[cfg(feature = "NavigationFocusReset")]
58    #[deprecated = "Use `set_focus_reset()` instead."]
59    pub fn focus_reset(&mut self, val: NavigationFocusReset) -> &mut Self {
60        self.set_focus_reset(val);
61        self
62    }
63    #[deprecated = "Use `set_handler()` instead."]
64    pub fn handler(&mut self, val: &::js_sys::Function) -> &mut Self {
65        self.set_handler(val);
66        self
67    }
68    #[cfg(feature = "NavigationScrollBehavior")]
69    #[deprecated = "Use `set_scroll()` instead."]
70    pub fn scroll(&mut self, val: NavigationScrollBehavior) -> &mut Self {
71        self.set_scroll(val);
72        self
73    }
74}
75impl Default for NavigationInterceptOptions {
76    fn default() -> Self {
77        Self::new()
78    }
79}