Files
sexy/lib/buttplug/types.ts
T

35 lines
967 B
TypeScript
Raw Normal View History

/**
* Normalized, app-level types for the Buttplug integration. Kept separate
* from `buttplug`'s own types so the rest of the app (UI, API payloads, DB
* rows) never has to import the client library directly.
*/
export type NormalizedOutputType = "vibrate" | "rotate" | "linear";
export type CommandType = NormalizedOutputType | "stop";
export interface ActuatorInfo {
featureIndex: number;
outputType: NormalizedOutputType;
/** True for outputs (e.g. HwPositionWithDuration) that require a move duration. */
requiresDuration: boolean;
descriptor: string;
}
export interface ConnectedDeviceInfo {
index: number;
name: string;
displayName?: string;
actuators: ActuatorInfo[];
hasBattery: boolean;
}
/** A single dispatched command, timestamped relative to session start. */
export interface CommandEvent {
tsMs: number;
deviceIndex: number;
commandType: CommandType;
featureIndex: number;
value: number;
durationMs?: number;
}