maxcountryman_web_sys/features/
gen_IntersectionObserver.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = IntersectionObserver , typescript_type = "IntersectionObserver")]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `IntersectionObserver` class."]
9 #[doc = ""]
10 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver)"]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"]
13 pub type IntersectionObserver;
14 #[cfg(feature = "Element")]
15 # [wasm_bindgen (structural , method , getter , js_class = "IntersectionObserver" , js_name = root)]
16 #[doc = "Getter for the `root` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/root)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserver`*"]
21 pub fn root(this: &IntersectionObserver) -> Option<Element>;
22 # [wasm_bindgen (structural , method , getter , js_class = "IntersectionObserver" , js_name = rootMargin)]
23 #[doc = "Getter for the `rootMargin` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"]
28 pub fn root_margin(this: &IntersectionObserver) -> String;
29 # [wasm_bindgen (structural , method , getter , js_class = "IntersectionObserver" , js_name = thresholds)]
30 #[doc = "Getter for the `thresholds` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"]
35 pub fn thresholds(this: &IntersectionObserver) -> ::js_sys::Array;
36 #[wasm_bindgen(catch, constructor, js_class = "IntersectionObserver")]
37 #[doc = "The `new IntersectionObserver(..)` constructor, creating a new instance of `IntersectionObserver`."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"]
42 pub fn new(intersection_callback: &::js_sys::Function)
43 -> Result<IntersectionObserver, JsValue>;
44 #[cfg(feature = "IntersectionObserverInit")]
45 #[wasm_bindgen(catch, constructor, js_class = "IntersectionObserver")]
46 #[doc = "The `new IntersectionObserver(..)` constructor, creating a new instance of `IntersectionObserver`."]
47 #[doc = ""]
48 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver)"]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`, `IntersectionObserverInit`*"]
51 pub fn new_with_options(
52 intersection_callback: &::js_sys::Function,
53 options: &IntersectionObserverInit,
54 ) -> Result<IntersectionObserver, JsValue>;
55 # [wasm_bindgen (method , structural , js_class = "IntersectionObserver" , js_name = disconnect)]
56 #[doc = "The `disconnect()` method."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/disconnect)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"]
61 pub fn disconnect(this: &IntersectionObserver);
62 #[cfg(feature = "Element")]
63 # [wasm_bindgen (method , structural , js_class = "IntersectionObserver" , js_name = observe)]
64 #[doc = "The `observe()` method."]
65 #[doc = ""]
66 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/observe)"]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserver`*"]
69 pub fn observe(this: &IntersectionObserver, target: &Element);
70 # [wasm_bindgen (method , structural , js_class = "IntersectionObserver" , js_name = takeRecords)]
71 #[doc = "The `takeRecords()` method."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/takeRecords)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"]
76 pub fn take_records(this: &IntersectionObserver) -> ::js_sys::Array;
77 #[cfg(feature = "Element")]
78 # [wasm_bindgen (method , structural , js_class = "IntersectionObserver" , js_name = unobserve)]
79 #[doc = "The `unobserve()` method."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/unobserve)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserver`*"]
84 pub fn unobserve(this: &IntersectionObserver, target: &Element);
85}