web_sys/features/
gen_GamepadEvent.rs

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