web_sys/features/
gen_GamepadHapticActuator.rs

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