lightweight-socket
Version:
lightweight socket
21 lines (18 loc) • 545 B
text/typescript
declare class Emitter {
protected listeners: {
[event: string]: Function[];
};
on(event: string, listener: Function): void;
once(event: string, listener: Function): void;
off(event: string, listener: Function): void;
}
declare class BrowserClient extends Emitter {
protected socket: WebSocket;
id: string;
constructor(url: string);
emit(name: string, ...args: any[]): void;
close(): void;
protected receive(event: MessageEvent): void;
protected init(): void;
}
export { BrowserClient };