Skip to main content

web_sys/features/
gen_ResizeObserver.rs

1#![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 = "ResizeObserver",
10        typescript_type = "ResizeObserver"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `ResizeObserver` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
18    pub type ResizeObserver;
19    #[wasm_bindgen(catch, constructor, js_class = "ResizeObserver")]
20    #[doc = "The `new ResizeObserver(..)` constructor, creating a new instance of `ResizeObserver`."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
25    pub fn new(callback: &::js_sys::Function) -> Result<ResizeObserver, JsValue>;
26    #[wasm_bindgen(method, js_class = "ResizeObserver")]
27    #[doc = "The `disconnect()` method."]
28    #[doc = ""]
29    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/disconnect)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
32    pub fn disconnect(this: &ResizeObserver);
33    #[cfg(feature = "Element")]
34    #[wasm_bindgen(method, js_class = "ResizeObserver")]
35    #[doc = "The `observe()` method."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"]
40    pub fn observe(this: &ResizeObserver, target: &Element);
41    #[cfg(all(feature = "Element", feature = "ResizeObserverOptions",))]
42    #[wasm_bindgen(method, js_class = "ResizeObserver", js_name = "observe")]
43    #[doc = "The `observe()` method."]
44    #[doc = ""]
45    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`, `ResizeObserverOptions`*"]
48    pub fn observe_with_options(
49        this: &ResizeObserver,
50        target: &Element,
51        options: &ResizeObserverOptions,
52    );
53    #[cfg(feature = "Element")]
54    #[wasm_bindgen(method, js_class = "ResizeObserver")]
55    #[doc = "The `unobserve()` method."]
56    #[doc = ""]
57    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve)"]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"]
60    pub fn unobserve(this: &ResizeObserver, target: &Element);
61}