1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "Performance",
11 typescript_type = "Performance"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `Performance` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
19 pub type Performance;
20 #[wasm_bindgen(method, getter, js_class = "Performance", js_name = "timeOrigin")]
21 #[doc = "Getter for the `timeOrigin` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
26 pub fn time_origin(this: &Performance) -> f64;
27 #[cfg(feature = "PerformanceTiming")]
28 #[wasm_bindgen(method, getter, js_class = "Performance", js_name = "timing")]
29 #[doc = "Getter for the `timing` field of this object."]
30 #[doc = ""]
31 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timing)"]
32 #[doc = ""]
33 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceTiming`*"]
34 pub fn timing(this: &Performance) -> PerformanceTiming;
35 #[cfg(feature = "PerformanceNavigation")]
36 #[wasm_bindgen(method, getter, js_class = "Performance", js_name = "navigation")]
37 #[doc = "Getter for the `navigation` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/navigation)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceNavigation`*"]
42 pub fn navigation(this: &Performance) -> PerformanceNavigation;
43 #[wasm_bindgen(
44 method,
45 getter,
46 js_class = "Performance",
47 js_name = "onresourcetimingbufferfull"
48 )]
49 #[doc = "Getter for the `onresourcetimingbufferfull` field of this object."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/onresourcetimingbufferfull)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
54 pub fn onresourcetimingbufferfull(this: &Performance) -> Option<::js_sys::Function>;
55 #[wasm_bindgen(
56 method,
57 setter,
58 js_class = "Performance",
59 js_name = "onresourcetimingbufferfull"
60 )]
61 #[doc = "Setter for the `onresourcetimingbufferfull` field of this object."]
62 #[doc = ""]
63 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/onresourcetimingbufferfull)"]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
66 pub fn set_onresourcetimingbufferfull(this: &Performance, value: Option<&::js_sys::Function>);
67 #[wasm_bindgen(method, js_class = "Performance", js_name = "clearMarks")]
68 #[doc = "The `clearMarks()` method."]
69 #[doc = ""]
70 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks)"]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
73 pub fn clear_marks(this: &Performance);
74 #[wasm_bindgen(method, js_class = "Performance", js_name = "clearMarks")]
75 #[doc = "The `clearMarks()` method."]
76 #[doc = ""]
77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks)"]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
80 pub fn clear_marks_with_mark_name(this: &Performance, mark_name: &str);
81 #[wasm_bindgen(method, js_class = "Performance", js_name = "clearMeasures")]
82 #[doc = "The `clearMeasures()` method."]
83 #[doc = ""]
84 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures)"]
85 #[doc = ""]
86 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
87 pub fn clear_measures(this: &Performance);
88 #[wasm_bindgen(method, js_class = "Performance", js_name = "clearMeasures")]
89 #[doc = "The `clearMeasures()` method."]
90 #[doc = ""]
91 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures)"]
92 #[doc = ""]
93 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
94 pub fn clear_measures_with_measure_name(this: &Performance, measure_name: &str);
95 #[wasm_bindgen(method, js_class = "Performance", js_name = "clearResourceTimings")]
96 #[doc = "The `clearResourceTimings()` method."]
97 #[doc = ""]
98 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearResourceTimings)"]
99 #[doc = ""]
100 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
101 pub fn clear_resource_timings(this: &Performance);
102 #[wasm_bindgen(method, js_class = "Performance", js_name = "getEntries")]
103 #[doc = "The `getEntries()` method."]
104 #[doc = ""]
105 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntries)"]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
108 pub fn get_entries(this: &Performance) -> ::js_sys::Array;
109 #[wasm_bindgen(method, js_class = "Performance", js_name = "getEntriesByName")]
110 #[doc = "The `getEntriesByName()` method."]
111 #[doc = ""]
112 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName)"]
113 #[doc = ""]
114 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
115 pub fn get_entries_by_name(this: &Performance, name: &str) -> ::js_sys::Array;
116 #[wasm_bindgen(method, js_class = "Performance", js_name = "getEntriesByName")]
117 #[doc = "The `getEntriesByName()` method."]
118 #[doc = ""]
119 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName)"]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
122 pub fn get_entries_by_name_with_entry_type(
123 this: &Performance,
124 name: &str,
125 entry_type: &str,
126 ) -> ::js_sys::Array;
127 #[wasm_bindgen(method, js_class = "Performance", js_name = "getEntriesByType")]
128 #[doc = "The `getEntriesByType()` method."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
133 pub fn get_entries_by_type(this: &Performance, entry_type: &str) -> ::js_sys::Array;
134 #[cfg(not(web_sys_unstable_apis))]
135 #[wasm_bindgen(catch, method, js_class = "Performance")]
136 #[doc = "The `mark()` method."]
137 #[doc = ""]
138 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)"]
139 #[doc = ""]
140 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
141 pub fn mark(this: &Performance, mark_name: &str) -> Result<(), JsValue>;
142 #[cfg(web_sys_unstable_apis)]
143 #[cfg(feature = "PerformanceMark")]
144 #[wasm_bindgen(catch, method, js_class = "Performance")]
145 #[doc = "The `mark()` method."]
146 #[doc = ""]
147 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)"]
148 #[doc = ""]
149 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceMark`*"]
150 #[doc = ""]
151 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
152 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
153 pub fn mark(this: &Performance, mark_name: &str) -> Result<PerformanceMark, JsValue>;
154 #[cfg(web_sys_unstable_apis)]
155 #[cfg(all(feature = "PerformanceMark", feature = "PerformanceMarkOptions",))]
156 #[wasm_bindgen(catch, method, js_class = "Performance", js_name = "mark")]
157 #[doc = "The `mark()` method."]
158 #[doc = ""]
159 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)"]
160 #[doc = ""]
161 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceMark`, `PerformanceMarkOptions`*"]
162 #[doc = ""]
163 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
164 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
165 pub fn mark_with_mark_options(
166 this: &Performance,
167 mark_name: &str,
168 mark_options: &PerformanceMarkOptions,
169 ) -> Result<PerformanceMark, JsValue>;
170 #[cfg(not(web_sys_unstable_apis))]
171 #[wasm_bindgen(catch, method, js_class = "Performance")]
172 #[doc = "The `measure()` method."]
173 #[doc = ""]
174 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
175 #[doc = ""]
176 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
177 pub fn measure(this: &Performance, measure_name: &str) -> Result<(), JsValue>;
178 #[cfg(not(web_sys_unstable_apis))]
179 #[wasm_bindgen(catch, method, js_class = "Performance", js_name = "measure")]
180 #[doc = "The `measure()` method."]
181 #[doc = ""]
182 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
183 #[doc = ""]
184 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
185 pub fn measure_with_start_mark(
186 this: &Performance,
187 measure_name: &str,
188 start_mark: &str,
189 ) -> Result<(), JsValue>;
190 #[cfg(not(web_sys_unstable_apis))]
191 #[wasm_bindgen(catch, method, js_class = "Performance", js_name = "measure")]
192 #[doc = "The `measure()` method."]
193 #[doc = ""]
194 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
195 #[doc = ""]
196 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
197 pub fn measure_with_start_mark_and_end_mark(
198 this: &Performance,
199 measure_name: &str,
200 start_mark: &str,
201 end_mark: &str,
202 ) -> Result<(), JsValue>;
203 #[cfg(web_sys_unstable_apis)]
204 #[cfg(feature = "PerformanceMeasure")]
205 #[wasm_bindgen(catch, method, js_class = "Performance")]
206 #[doc = "The `measure()` method."]
207 #[doc = ""]
208 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
209 #[doc = ""]
210 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceMeasure`*"]
211 #[doc = ""]
212 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
213 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
214 pub fn measure(this: &Performance, measure_name: &str) -> Result<PerformanceMeasure, JsValue>;
215 #[cfg(web_sys_unstable_apis)]
216 #[cfg(feature = "PerformanceMeasure")]
217 #[wasm_bindgen(catch, method, js_class = "Performance", js_name = "measure")]
218 #[doc = "The `measure()` method."]
219 #[doc = ""]
220 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
221 #[doc = ""]
222 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceMeasure`*"]
223 #[doc = ""]
224 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
225 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
226 pub fn measure_with_str(
227 this: &Performance,
228 measure_name: &str,
229 start_or_measure_options: &str,
230 ) -> Result<PerformanceMeasure, JsValue>;
231 #[cfg(web_sys_unstable_apis)]
232 #[cfg(feature = "PerformanceMeasure")]
233 #[wasm_bindgen(catch, method, js_class = "Performance", js_name = "measure")]
234 #[doc = "The `measure()` method."]
235 #[doc = ""]
236 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
237 #[doc = ""]
238 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceMeasure`*"]
239 #[doc = ""]
240 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
241 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
242 pub fn measure_with_str_and_end_mark(
243 this: &Performance,
244 measure_name: &str,
245 start_or_measure_options: &str,
246 end_mark: &str,
247 ) -> Result<PerformanceMeasure, JsValue>;
248 #[cfg(web_sys_unstable_apis)]
249 #[cfg(all(feature = "PerformanceMeasure", feature = "PerformanceMeasureOptions",))]
250 #[wasm_bindgen(catch, method, js_class = "Performance", js_name = "measure")]
251 #[doc = "The `measure()` method."]
252 #[doc = ""]
253 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure)"]
254 #[doc = ""]
255 #[doc = "*This API requires the following crate features to be activated: `Performance`, `PerformanceMeasure`, `PerformanceMeasureOptions`*"]
256 #[doc = ""]
257 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
258 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
259 pub fn measure_with_performance_measure_options(
260 this: &Performance,
261 measure_name: &str,
262 start_or_measure_options: &PerformanceMeasureOptions,
263 ) -> Result<PerformanceMeasure, JsValue>;
264 #[cfg(web_sys_unstable_apis)]
265 #[cfg(feature = "MemoryMeasurement")]
266 #[wasm_bindgen(
267 method,
268 js_class = "Performance",
269 js_name = "measureUserAgentSpecificMemory"
270 )]
271 #[doc = "The `measureUserAgentSpecificMemory()` method."]
272 #[doc = ""]
273 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measureUserAgentSpecificMemory)"]
274 #[doc = ""]
275 #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`, `Performance`*"]
276 #[doc = ""]
277 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
278 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
279 pub fn measure_user_agent_specific_memory(
280 this: &Performance,
281 ) -> ::js_sys::Promise<MemoryMeasurement>;
282 #[wasm_bindgen(method, js_class = "Performance")]
283 #[doc = "The `now()` method."]
284 #[doc = ""]
285 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now)"]
286 #[doc = ""]
287 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
288 pub fn now(this: &Performance) -> f64;
289 #[wasm_bindgen(
290 method,
291 js_class = "Performance",
292 js_name = "setResourceTimingBufferSize"
293 )]
294 #[doc = "The `setResourceTimingBufferSize()` method."]
295 #[doc = ""]
296 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/setResourceTimingBufferSize)"]
297 #[doc = ""]
298 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
299 pub fn set_resource_timing_buffer_size(this: &Performance, max_size: u32);
300 #[wasm_bindgen(method, js_class = "Performance", js_name = "toJSON")]
301 #[doc = "The `toJSON()` method."]
302 #[doc = ""]
303 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON)"]
304 #[doc = ""]
305 #[doc = "*This API requires the following crate features to be activated: `Performance`*"]
306 pub fn to_json(this: &Performance) -> ::js_sys::Object;
307}