mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Add type definitions for w3cwebsocket in the websocket package (#25355)
This commit is contained in:
Vendored
+29
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user