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