From c32177d0cdfd4e04102a845925bd012c7f33e3fd Mon Sep 17 00:00:00 2001 From: Zhuohuan LI Date: Sun, 24 Jul 2016 20:21:53 +0800 Subject: [PATCH] type alias for 2 callback, fix #10250 --- ws/ws.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ws/ws.d.ts b/ws/ws.d.ts index 235b538030..6b94bee19d 100644 --- a/ws/ws.d.ts +++ b/ws/ws.d.ts @@ -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;