Haptic patterns
Author bounded device-local taps and sustained vibrations with timing, intensity, sharpness and optional preset fallback.
Public exports
Import from @scape-wtf/sdk.
GizmoHaptic, GizmoHapticEvent, GizmoHapticPattern, gizmoHapticError.
Type declarations
Import the public exports listed above from the package entry point.
ts
/** Device-local feedback. All times are milliseconds; intensity/sharpness are 0–1. */
export type GizmoHapticEvent = {
kind: 'transient';
delayMs: number;
intensity: number;
sharpness: number;
} | {
kind: 'continuous';
delayMs: number;
durationMs: number;
intensity: number;
sharpness: number;
};
export interface GizmoHapticPattern {
/** 1–16 events, ending within 2000 ms. New patterns replace active custom playback. */
events: GizmoHapticEvent[];
/** Optional preset for older native builds or devices without pattern support. */
fallback?: 'light' | 'heavy';
}
export type GizmoHaptic = 'light' | 'heavy' | GizmoHapticPattern;
export declare function gizmoHapticError(value: unknown, durationMs?: number): string | null;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Usage and limits
See Gizmo guides, working examples, and limits for lifecycle, validation and Scape behavior.
