web_sys/features/
gen_Gamepad.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "::js_sys::Object",
9 js_name = "Gamepad",
10 typescript_type = "Gamepad"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `Gamepad` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
18 pub type Gamepad;
19 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "id")]
20 #[doc = "Getter for the `id` field of this object."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/id)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
25 pub fn id(this: &Gamepad) -> ::alloc::string::String;
26 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "index")]
27 #[doc = "Getter for the `index` field of this object."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/index)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
32 pub fn index(this: &Gamepad) -> u32;
33 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "connected")]
34 #[doc = "Getter for the `connected` field of this object."]
35 #[doc = ""]
36 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/connected)"]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
39 pub fn connected(this: &Gamepad) -> bool;
40 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "timestamp")]
41 #[doc = "Getter for the `timestamp` field of this object."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/timestamp)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
46 pub fn timestamp(this: &Gamepad) -> f64;
47 #[cfg(feature = "GamepadMappingType")]
48 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "mapping")]
49 #[doc = "Getter for the `mapping` field of this object."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/mapping)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadMappingType`*"]
54 pub fn mapping(this: &Gamepad) -> GamepadMappingType;
55 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "axes")]
56 #[doc = "Getter for the `axes` field of this object."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/axes)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
61 pub fn axes(this: &Gamepad) -> ::js_sys::Array;
62 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "buttons")]
63 #[doc = "Getter for the `buttons` field of this object."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/buttons)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
68 pub fn buttons(this: &Gamepad) -> ::js_sys::Array;
69 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "displayId")]
70 #[doc = "Getter for the `displayId` field of this object."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/displayId)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
75 #[deprecated]
76 pub fn display_id(this: &Gamepad) -> u32;
77 #[cfg(feature = "GamepadHand")]
78 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "hand")]
79 #[doc = "Getter for the `hand` field of this object."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hand)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadHand`*"]
84 pub fn hand(this: &Gamepad) -> GamepadHand;
85 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "hapticActuators")]
86 #[doc = "Getter for the `hapticActuators` field of this object."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hapticActuators)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"]
91 pub fn haptic_actuators(this: &Gamepad) -> ::js_sys::Array;
92 #[cfg(feature = "GamepadPose")]
93 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "pose")]
94 #[doc = "Getter for the `pose` field of this object."]
95 #[doc = ""]
96 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/pose)"]
97 #[doc = ""]
98 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadPose`*"]
99 pub fn pose(this: &Gamepad) -> Option<GamepadPose>;
100 #[cfg(web_sys_unstable_apis)]
101 #[cfg(feature = "GamepadHapticActuator")]
102 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "vibrationActuator")]
103 #[doc = "Getter for the `vibrationActuator` field of this object."]
104 #[doc = ""]
105 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/vibrationActuator)"]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadHapticActuator`*"]
108 #[doc = ""]
109 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
110 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
111 pub fn vibration_actuator(this: &Gamepad) -> GamepadHapticActuator;
112 #[cfg(web_sys_unstable_apis)]
113 #[cfg(feature = "GamepadTouch")]
114 #[wasm_bindgen(method, getter, js_class = "Gamepad", js_name = "touchEvents")]
115 #[doc = "Getter for the `touchEvents` field of this object."]
116 #[doc = ""]
117 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/touchEvents)"]
118 #[doc = ""]
119 #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadTouch`*"]
120 #[doc = ""]
121 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
122 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
123 pub fn touch_events(this: &Gamepad) -> Option<::js_sys::Array<GamepadTouch>>;
124}