web_sys/features/
gen_GamepadHapticActuator.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 = "GamepadHapticActuator",
10 typescript_type = "GamepadHapticActuator"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `GamepadHapticActuator` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`*"]
18 pub type GamepadHapticActuator;
19 #[cfg(feature = "GamepadHapticActuatorType")]
20 #[wasm_bindgen(method, getter, js_class = "GamepadHapticActuator", js_name = "type")]
21 #[doc = "Getter for the `type` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/type)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`, `GamepadHapticActuatorType`*"]
26 #[deprecated]
27 pub fn type_(this: &GamepadHapticActuator) -> GamepadHapticActuatorType;
28 #[cfg(web_sys_unstable_apis)]
29 #[wasm_bindgen(
30 method,
31 getter,
32 js_class = "GamepadHapticActuator",
33 js_name = "effects"
34 )]
35 #[doc = "Getter for the `effects` field of this object."]
36 #[doc = ""]
37 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/effects)"]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`*"]
40 #[doc = ""]
41 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43 pub fn effects(this: &GamepadHapticActuator) -> ::js_sys::Array<::js_sys::JsString>;
44 #[cfg(web_sys_unstable_apis)]
45 #[cfg(feature = "GamepadHapticEffectType")]
46 #[wasm_bindgen(method, js_class = "GamepadHapticActuator", js_name = "playEffect")]
47 #[doc = "The `playEffect()` method."]
48 #[doc = ""]
49 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/playEffect)"]
50 #[doc = ""]
51 #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`, `GamepadHapticEffectType`*"]
52 #[doc = ""]
53 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
55 pub fn play_effect(
56 this: &GamepadHapticActuator,
57 type_: GamepadHapticEffectType,
58 ) -> ::js_sys::Promise<::js_sys::JsString>;
59 #[cfg(web_sys_unstable_apis)]
60 #[cfg(all(
61 feature = "GamepadEffectParameters",
62 feature = "GamepadHapticEffectType",
63 ))]
64 #[wasm_bindgen(method, js_class = "GamepadHapticActuator", js_name = "playEffect")]
65 #[doc = "The `playEffect()` method."]
66 #[doc = ""]
67 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/playEffect)"]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`, `GamepadHapticActuator`, `GamepadHapticEffectType`*"]
70 #[doc = ""]
71 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 pub fn play_effect_with_params(
74 this: &GamepadHapticActuator,
75 type_: GamepadHapticEffectType,
76 params: &GamepadEffectParameters,
77 ) -> ::js_sys::Promise<::js_sys::JsString>;
78 #[wasm_bindgen(catch, method, js_class = "GamepadHapticActuator")]
79 #[doc = "The `pulse()` method."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/pulse)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`*"]
84 pub fn pulse(
85 this: &GamepadHapticActuator,
86 value: f64,
87 duration: f64,
88 ) -> Result<::js_sys::Promise, JsValue>;
89 #[cfg(web_sys_unstable_apis)]
90 #[wasm_bindgen(method, js_class = "GamepadHapticActuator")]
91 #[doc = "The `reset()` method."]
92 #[doc = ""]
93 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/reset)"]
94 #[doc = ""]
95 #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`*"]
96 #[doc = ""]
97 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
98 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
99 pub fn reset(this: &GamepadHapticActuator) -> ::js_sys::Promise<::js_sys::JsString>;
100}