web_sys/features/
gen_FocusEvent.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "UiEvent",
9 extends = "Event",
10 extends = "::js_sys::Object",
11 js_name = "FocusEvent",
12 typescript_type = "FocusEvent"
13 )]
14 #[derive(Debug, Clone, PartialEq, Eq)]
15 #[doc = "The `FocusEvent` class."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `FocusEvent`*"]
20 pub type FocusEvent;
21 #[cfg(feature = "EventTarget")]
22 #[wasm_bindgen(method, getter, js_class = "FocusEvent", js_name = "relatedTarget")]
23 #[doc = "Getter for the `relatedTarget` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/relatedTarget)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `FocusEvent`*"]
28 pub fn related_target(this: &FocusEvent) -> Option<EventTarget>;
29 #[wasm_bindgen(catch, constructor, js_class = "FocusEvent")]
30 #[doc = "The `new FocusEvent(..)` constructor, creating a new instance of `FocusEvent`."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `FocusEvent`*"]
35 pub fn new(type_arg: &str) -> Result<FocusEvent, JsValue>;
36 #[cfg(feature = "FocusEventInit")]
37 #[wasm_bindgen(catch, constructor, js_class = "FocusEvent")]
38 #[doc = "The `new FocusEvent(..)` constructor, creating a new instance of `FocusEvent`."]
39 #[doc = ""]
40 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)"]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `FocusEvent`, `FocusEventInit`*"]
43 pub fn new_with_focus_event_init_dict(
44 type_arg: &str,
45 focus_event_init_dict: &FocusEventInit,
46 ) -> Result<FocusEvent, JsValue>;
47}