Skip to content

1681-engine / index / HapticsOptions

Interface: HapticsOptions<K> ​

Defined in: src/input/haptics.ts:32

Type Parameters ​

Type Parameter
K extends string

Properties ​

enabled? ​

ts
optional enabled?: () => boolean;

Defined in: src/input/haptics.ts:39

Asked before every buzz (the player's setting, a native-only rule). Default: always.

Returns ​

boolean


gaps? ​

ts
optional gaps?: Readonly<Partial<Record<K, number>>>;

Defined in: src/input/haptics.ts:33


now? ​

ts
optional now?: () => number;

Defined in: src/input/haptics.ts:41

Default performance.now.

Returns ​

number


patterns? ​

ts
optional patterns?: Readonly<Partial<Record<K, number | readonly number[]>>>;

Defined in: src/input/haptics.ts:37

The Vibration API pattern per kind for the default play (ms, or on/off ms; default 15).


play? ​

ts
optional play?: (kind) => unknown;

Defined in: src/input/haptics.ts:35

Plays a buzz. A promise it returns may reject: that is swallowed, a buzz is never worth an error.

Parameters ​

ParameterType
kindK

Returns ​

unknown

Released under the MIT License.