web_sys/features/
gen_GamepadEventInit.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GamepadEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GamepadEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
12 pub type GamepadEventInit;
13 #[doc = "Get the `bubbles` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
16 #[wasm_bindgen(method, getter = "bubbles")]
17 pub fn get_bubbles(this: &GamepadEventInit) -> Option<bool>;
18 #[doc = "Change the `bubbles` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
21 #[wasm_bindgen(method, setter = "bubbles")]
22 pub fn set_bubbles(this: &GamepadEventInit, val: bool);
23 #[doc = "Get the `cancelable` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
26 #[wasm_bindgen(method, getter = "cancelable")]
27 pub fn get_cancelable(this: &GamepadEventInit) -> Option<bool>;
28 #[doc = "Change the `cancelable` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
31 #[wasm_bindgen(method, setter = "cancelable")]
32 pub fn set_cancelable(this: &GamepadEventInit, val: bool);
33 #[doc = "Get the `composed` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
36 #[wasm_bindgen(method, getter = "composed")]
37 pub fn get_composed(this: &GamepadEventInit) -> Option<bool>;
38 #[doc = "Change the `composed` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
41 #[wasm_bindgen(method, setter = "composed")]
42 pub fn set_composed(this: &GamepadEventInit, val: bool);
43 #[cfg(feature = "Gamepad")]
44 #[doc = "Get the `gamepad` field of this object."]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadEventInit`*"]
47 #[wasm_bindgen(method, getter = "gamepad")]
48 pub fn get_gamepad(this: &GamepadEventInit) -> Option<Gamepad>;
49 #[cfg(feature = "Gamepad")]
50 #[doc = "Change the `gamepad` field of this object."]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadEventInit`*"]
53 #[wasm_bindgen(method, setter = "gamepad")]
54 pub fn set_gamepad(this: &GamepadEventInit, val: Option<&Gamepad>);
55}
56impl GamepadEventInit {
57 #[doc = "Construct a new `GamepadEventInit`."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"]
60 pub fn new() -> Self {
61 #[allow(unused_mut)]
62 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
63 ret
64 }
65 #[deprecated = "Use `set_bubbles()` instead."]
66 pub fn bubbles(&mut self, val: bool) -> &mut Self {
67 self.set_bubbles(val);
68 self
69 }
70 #[deprecated = "Use `set_cancelable()` instead."]
71 pub fn cancelable(&mut self, val: bool) -> &mut Self {
72 self.set_cancelable(val);
73 self
74 }
75 #[deprecated = "Use `set_composed()` instead."]
76 pub fn composed(&mut self, val: bool) -> &mut Self {
77 self.set_composed(val);
78 self
79 }
80 #[cfg(feature = "Gamepad")]
81 #[deprecated = "Use `set_gamepad()` instead."]
82 pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self {
83 self.set_gamepad(val);
84 self
85 }
86}
87impl Default for GamepadEventInit {
88 fn default() -> Self {
89 Self::new()
90 }
91}