adds constructor to pass tests

Need two constructors because https://github.com/websockets/ws/blob/master/lib/WebSocket.js\#L58
This commit is contained in:
Viktor Hedefalk
2016-08-30 14:35:05 +02:00
parent 37c50a8e4b
commit cc8642a40d

35
ws/ws.d.ts vendored
View File

@@ -34,21 +34,8 @@ declare module "ws" {
onclose: (event: {wasClean: boolean; code: number; reason: string; target: WebSocket}) => void;
onmessage: (event: {data: any; type: string; target: WebSocket}) => void;
constructor(address: string, protocols?: string | string[], options?: {
protocol?: string;
agent?: http.Agent;
headers?: {[key: string]: string};
protocolVersion?: any;
host?: string;
origin?: string;
pfx?: any;
key?: any;
passphrase?: string;
cert?: any;
ca?: any[];
ciphers?: string;
rejectUnauthorized?: boolean;
});
constructor(address: string, options?: WebSocket.IClientOptions);
constructor(address: string, protocols?: string | string[], options?: WebSocket.IClientOptions);
close(code?: number, data?: any): void;
pause(): void;
@@ -92,7 +79,23 @@ declare module "ws" {
type VerifyClientCallbackSync = (info: {origin: string; secure: boolean; req: http.ServerRequest}) => boolean;
type VerifyClientCallbackAsync = (info: {origin: string; secure: boolean; req: http.ServerRequest}
, callback: (res: boolean) => void) => void;
export interface IClientOptions {
protocol?: string;
agent?: http.Agent;
headers?: {[key: string]: string};
protocolVersion?: any;
host?: string;
origin?: string;
pfx?: any;
key?: any;
passphrase?: string;
cert?: any;
ca?: any[];
ciphers?: string;
rejectUnauthorized?: boolean;
}
export interface IServerOptions {
host?: string;
port?: number;