type alias for 2 callback, fix #10250

This commit is contained in:
Zhuohuan LI
2016-07-24 20:21:53 +08:00
parent f7163677f8
commit c32177d0cd

12
ws/ws.d.ts vendored
View File

@@ -88,16 +88,16 @@ declare module "ws" {
}
namespace WebSocket {
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 IServerOptions {
host?: string;
port?: number;
server?: http.Server;
verifyClient?: (
((info: {origin: string; secure: boolean; req: http.ServerRequest}) => boolean)
|
((info: {origin: string; secure: boolean; req: http.ServerRequest},
callback: (res: boolean) => void) => void)
);
verifyClient?: VerifyClientCallbackAsync | VerifyClientCallbackSync;
handleProtocols?: any;
path?: string;
noServer?: boolean;