web_sys/features/
gen_IntersectionObserverEntryInit.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 = IntersectionObserverEntryInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `IntersectionObserverEntryInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"]
12    pub type IntersectionObserverEntryInit;
13    #[cfg(feature = "DomRectInit")]
14    #[doc = "Get the `boundingClientRect` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"]
17    #[wasm_bindgen(method, getter = "boundingClientRect")]
18    pub fn get_bounding_client_rect(this: &IntersectionObserverEntryInit) -> DomRectInit;
19    #[cfg(feature = "DomRectInit")]
20    #[doc = "Change the `boundingClientRect` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"]
23    #[wasm_bindgen(method, setter = "boundingClientRect")]
24    pub fn set_bounding_client_rect(this: &IntersectionObserverEntryInit, val: &DomRectInit);
25    #[cfg(feature = "DomRectInit")]
26    #[doc = "Get the `intersectionRect` field of this object."]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"]
29    #[wasm_bindgen(method, getter = "intersectionRect")]
30    pub fn get_intersection_rect(this: &IntersectionObserverEntryInit) -> DomRectInit;
31    #[cfg(feature = "DomRectInit")]
32    #[doc = "Change the `intersectionRect` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"]
35    #[wasm_bindgen(method, setter = "intersectionRect")]
36    pub fn set_intersection_rect(this: &IntersectionObserverEntryInit, val: &DomRectInit);
37    #[cfg(feature = "DomRectInit")]
38    #[doc = "Get the `rootBounds` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"]
41    #[wasm_bindgen(method, getter = "rootBounds")]
42    pub fn get_root_bounds(this: &IntersectionObserverEntryInit) -> DomRectInit;
43    #[cfg(feature = "DomRectInit")]
44    #[doc = "Change the `rootBounds` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"]
47    #[wasm_bindgen(method, setter = "rootBounds")]
48    pub fn set_root_bounds(this: &IntersectionObserverEntryInit, val: &DomRectInit);
49    #[cfg(feature = "Element")]
50    #[doc = "Get the `target` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverEntryInit`*"]
53    #[wasm_bindgen(method, getter = "target")]
54    pub fn get_target(this: &IntersectionObserverEntryInit) -> Element;
55    #[cfg(feature = "Element")]
56    #[doc = "Change the `target` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverEntryInit`*"]
59    #[wasm_bindgen(method, setter = "target")]
60    pub fn set_target(this: &IntersectionObserverEntryInit, val: &Element);
61    #[doc = "Get the `time` field of this object."]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"]
64    #[wasm_bindgen(method, getter = "time")]
65    pub fn get_time(this: &IntersectionObserverEntryInit) -> f64;
66    #[doc = "Change the `time` field of this object."]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"]
69    #[wasm_bindgen(method, setter = "time")]
70    pub fn set_time(this: &IntersectionObserverEntryInit, val: f64);
71}
72impl IntersectionObserverEntryInit {
73    #[cfg(all(feature = "DomRectInit", feature = "Element",))]
74    #[doc = "Construct a new `IntersectionObserverEntryInit`."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `Element`, `IntersectionObserverEntryInit`*"]
77    pub fn new(
78        bounding_client_rect: &DomRectInit,
79        intersection_rect: &DomRectInit,
80        root_bounds: &DomRectInit,
81        target: &Element,
82        time: f64,
83    ) -> Self {
84        #[allow(unused_mut)]
85        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
86        ret.set_bounding_client_rect(bounding_client_rect);
87        ret.set_intersection_rect(intersection_rect);
88        ret.set_root_bounds(root_bounds);
89        ret.set_target(target);
90        ret.set_time(time);
91        ret
92    }
93    #[cfg(feature = "DomRectInit")]
94    #[deprecated = "Use `set_bounding_client_rect()` instead."]
95    pub fn bounding_client_rect(&mut self, val: &DomRectInit) -> &mut Self {
96        self.set_bounding_client_rect(val);
97        self
98    }
99    #[cfg(feature = "DomRectInit")]
100    #[deprecated = "Use `set_intersection_rect()` instead."]
101    pub fn intersection_rect(&mut self, val: &DomRectInit) -> &mut Self {
102        self.set_intersection_rect(val);
103        self
104    }
105    #[cfg(feature = "DomRectInit")]
106    #[deprecated = "Use `set_root_bounds()` instead."]
107    pub fn root_bounds(&mut self, val: &DomRectInit) -> &mut Self {
108        self.set_root_bounds(val);
109        self
110    }
111    #[cfg(feature = "Element")]
112    #[deprecated = "Use `set_target()` instead."]
113    pub fn target(&mut self, val: &Element) -> &mut Self {
114        self.set_target(val);
115        self
116    }
117    #[deprecated = "Use `set_time()` instead."]
118    pub fn time(&mut self, val: f64) -> &mut Self {
119        self.set_time(val);
120        self
121    }
122}