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