UNPKG

leafx

Version:

WebSocket Client & Utilities

19 lines (16 loc) 654 B
import * as mitt from 'mitt'; declare function create(url: string): { on: { <Key extends mitt.EventType>(type: Key, handler: mitt.Handler<Record<mitt.EventType, unknown>[Key]>): void; (type: "*", handler: mitt.WildcardHandler<Record<mitt.EventType, unknown>>): void; }; off: { <Key_1 extends mitt.EventType>(type: Key_1, handler?: mitt.Handler<Record<mitt.EventType, unknown>[Key_1]> | undefined): void; (type: "*", handler: mitt.WildcardHandler<Record<mitt.EventType, unknown>>): void; }; clear: () => void; close(): void; reconnect(): any; send<T>(data: T): void; }; export { create };