Add type definitions for w3cwebsocket in the websocket package (#25355)

This commit is contained in:
Brandon Millman
2018-05-04 14:00:33 -07:00
committed by Andy
parent da8016d71f
commit a1a7755d2a
+29
View File
@@ -670,6 +670,35 @@ declare class router extends events.EventEmitter {
}
declare class w3cwebsocket {
static CONNECTING: number;
static OPEN: number;
static CLOSING: number;
static CLOSED: number;
url: string;
readyState: number;
protocol?: string;
extenstions: IExtension[];
bufferedAmount: number;
CONNECTING: number;
OPEN: number;
CLOSING: number;
CLOSED: number;
onopen: () => void;
onerror: (error: Error) => void;
onclose: () => void;
onmessage: (message: any) => void;
constructor(url: string, protocols?: string[], origin?: string, headers?: any[], requestOptions?: object, clientConfig?: IClientConfig);
send(data: Buffer): void;
send(data: IStringified): void;
close(code?: number, reason?: string): void;
}
export declare var version: string;
export declare var constants: {
DEBUG: boolean;