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 = "ScrollLogicalPosition")]
38    #[doc = "Get the `inline` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"]
41    #[wasm_bindgen(method, getter = "inline")]
42    pub fn get_inline(this: &ScrollIntoViewOptions) -> Option<ScrollLogicalPosition>;
43    #[cfg(feature = "ScrollLogicalPosition")]
44    #[doc = "Change the `inline` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"]
47    #[wasm_bindgen(method, setter = "inline")]
48    pub fn set_inline(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition);
49}
50impl ScrollIntoViewOptions {
51    #[doc = "Construct a new `ScrollIntoViewOptions`."]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`*"]
54    pub fn new() -> Self {
55        #[allow(unused_mut)]
56        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
57        ret
58    }
59    #[cfg(feature = "ScrollBehavior")]
60    #[deprecated = "Use `set_behavior()` instead."]
61    pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self {
62        self.set_behavior(val);
63        self
64    }
65    #[cfg(feature = "ScrollLogicalPosition")]
66    #[deprecated = "Use `set_block()` instead."]
67    pub fn block(&mut self, val: ScrollLogicalPosition) -> &mut Self {
68        self.set_block(val);
69        self
70    }
71    #[cfg(feature = "ScrollLogicalPosition")]
72    #[deprecated = "Use `set_inline()` instead."]
73    pub fn inline(&mut self, val: ScrollLogicalPosition) -> &mut Self {
74        self.set_inline(val);
75        self
76    }
77}
78impl Default for ScrollIntoViewOptions {
79    fn default() -> Self {
80        Self::new()
81    }
82}