Skip to main content

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