ziron-client
Version:
21 lines (20 loc) • 714 B
TypeScript
import { ClientOptions } from 'ws';
export interface WebSocket {
close(code?: number, reason?: string): void;
send(data: string | ArrayBuffer | Blob): void;
onopen: (event: any) => void;
onclose: (event: any) => void;
onmessage: (event: any) => void;
onerror: (event: any) => void;
/**
* @description
* It gets called when some backpressure
* has drained from the write buffer.
* @param backpressure
*/
ondrain?: (backpressure: number) => void;
binaryType: 'arraybuffer' | 'blob';
bufferedAmount: number;
readyState: number;
}
export declare let createWebSocket: (url: string, protocol: string | string[], options?: ClientOptions) => WebSocket;