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;