web_sys/features/
gen_ScrollIntoViewOptions.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 = ScrollIntoViewOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ScrollIntoViewOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`*"]
12    pub type ScrollIntoViewOptions;
13    #[cfg(feature = "ScrollBehavior")]
14    #[doc = "Get the `behavior` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollIntoViewOptions`*"]
17    #[wasm_bindgen(method, getter = "behavior")]
18    pub fn get_behavior(this: &ScrollIntoViewOptions) -> Option<ScrollBehavior>;
19    #[cfg(feature = "ScrollBehavior")]
20    #[doc = "Change the `behavior` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollIntoViewOptions`*"]
23    #[wasm_bindgen(method, setter = "behavior")]
24    pub fn set_behavior(this: &ScrollIntoViewOptions, val: ScrollBehavior);
25    #[cfg(feature = "ScrollLogicalPosition")]
26    #[doc = "Get the `block` field of this object."]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"]
29    #[wasm_bindgen(method, getter = "block")]
30    pub fn get_block(this: &ScrollIntoViewOptions) -> Option<ScrollLogicalPosition>;
31    #[cfg(feature = "ScrollLogicalPosition")]
32    #[doc = "Change the `block` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"]
35    #[wasm_bindgen(method, setter = "block")]
36    pub fn set_block(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition);
37    #[cfg(feature = "ScrollIntoViewContainer")]
38    #[doc = "Get the `container` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewContainer`, `ScrollIntoViewOptions`*"]
41    #[wasm_bindgen(method, getter = "container")]
42    pub fn get_container(this: &ScrollIntoViewOptions) -> Option<ScrollIntoViewContainer>;
43    #[cfg(feature = "ScrollIntoViewContainer")]
44    #[doc = "Change the `container` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewContainer`, `ScrollIntoViewOptions`*"]
47    #[wasm_bindgen(method, setter = "container")]
48    pub fn set_container(this: &ScrollIntoViewOptions, val: ScrollIntoViewContainer);
49    #[cfg(feature = "ScrollLogicalPosition")]
50    #[doc = "Get the `inline` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"]
53    #[wasm_bindgen(method, getter = "inline")]
54    pub fn get_inline(this: &ScrollIntoViewOptions) -> Option<ScrollLogicalPosition>;
55    #[cfg(feature = "ScrollLogicalPosition")]
56    #[doc = "Change the `inline` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"]
59    #[wasm_bindgen(method, setter = "inline")]
60    pub fn set_inline(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition);
61}
62impl ScrollIntoViewOptions {
63    #[doc = "Construct a new `ScrollIntoViewOptions`."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`*"]
66    pub fn new() -> Self {
67        #[allow(unused_mut)]
68        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
69        ret
70    }
71    #[cfg(feature = "ScrollBehavior")]
72    #[deprecated = "Use `set_behavior()` instead."]
73    pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self {
74        self.set_behavior(val);
75        self
76    }
77    #[cfg(feature = "ScrollLogicalPosition")]
78    #[deprecated = "Use `set_block()` instead."]
79    pub fn block(&mut self, val: ScrollLogicalPosition) -> &mut Self {
80        self.set_block(val);
81        self
82    }
83    #[cfg(feature = "ScrollIntoViewContainer")]
84    #[deprecated = "Use `set_container()` instead."]
85    pub fn container(&mut self, val: ScrollIntoViewContainer) -> &mut Self {
86        self.set_container(val);
87        self
88    }
89    #[cfg(feature = "ScrollLogicalPosition")]
90    #[deprecated = "Use `set_inline()` instead."]
91    pub fn inline(&mut self, val: ScrollLogicalPosition) -> &mut Self {
92        self.set_inline(val);
93        self
94    }
95}
96impl Default for ScrollIntoViewOptions {
97    fn default() -> Self {
98        Self::new()
99    }
100}