UNPKG

ive-connect

Version:

A universal haptic device control library for interactive experiences

20 lines (19 loc) 547 B
/** * Minimal Buttplug v4 WebSocket transport */ type MessageHandler = (type: string, payload: any) => void; export declare class ButtplugWs { private ws; private msgId; private pending; private pingTimer; private onMessage; constructor(onMessage: MessageHandler); get connected(): boolean; open(url: string, clientName: string): Promise<void>; send(type: string, payload: Record<string, unknown>): Promise<Record<string, unknown>>; close(): void; private handleRaw; private cleanup; } export {};