web_sys/features/
gen_FocusEvent.rs

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