From 4d7168f75d852841243ebd897dbb7296fb7024f0 Mon Sep 17 00:00:00 2001 From: Marcus Nielsen Date: Sun, 13 Nov 2016 10:41:42 +0100 Subject: [PATCH] Seems like the error callback is malformatted (#12477) * Seems like the error callback is malformatted New to typescript, but it complains on my cb function since it expects an error argument and doesn't return an object. I proposed these changes, but haven't done any typescripting really (trying to migrate to TS), so feel free to deny this PR if it's wrong. I did check with the source code in ws before suggesting this though. * Updated argument with an optional any type --- ws/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ws/index.d.ts b/ws/index.d.ts index 353509bbae..6f7d3ff21b 100644 --- a/ws/index.d.ts +++ b/ws/index.d.ts @@ -135,7 +135,7 @@ declare namespace WebSocket { constructor(options?: IServerOptions, callback?: Function); - close(cb?: () => {}): void; + close(cb?: (err?: any) => void): void; handleUpgrade(request: http.IncomingMessage, socket: net.Socket, upgradeHead: Buffer, callback: (client: WebSocket) => void): void;