Merge pull request #26551 from moimael/fix-koa-websocket-types

[koa-websocket] Support passing ws options to listen.
This commit is contained in:
Nathan Shively-Sanders
2018-06-20 14:28:16 -07:00
committed by GitHub
+3 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for koa-websocket 2.1
// Type definitions for koa-websocket 5.0
// Project: https://github.com/kudos/koa-websocket
// Definitions by: My Self <https://github.com/me>
// Definitions by: Maël Lavault <https://github.com/moimael>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -21,7 +21,7 @@ declare class KoaWebsocketServer {
middleware: Koa.Middleware[];
constructor(app: Koa);
listen(server: http.Server | https.Server): ws.Server;
listen(options: ws.ServerOptions): ws.Server;
onConnection(handler: KoaWebsocketConnectionHandler): void;
use(middleware: KoaWebsocketMiddleware): this;
}