File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ declare module 'fastify' {
4040 > ,
4141 handler ?: WebsocketHandler < HttpRequest , HttpResponse >
4242 ) : FastifyInstance < HttpServer , HttpRequest , HttpResponse > ;
43+
44+ websocketServer : WebSocket . Server ;
4345 }
4446
4547 interface RouteOptions <
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const fastify = require('fastify');
33import { SocketStream } from '../..' ;
44import { WebsocketHandler , FastifyRequest , FastifyInstance } from 'fastify' ;
55import { expectType } from 'tsd' ;
6+ import { Server } from 'ws' ;
67
78const app : FastifyInstance = fastify ( ) ;
89app . register ( wsPlugin ) ;
@@ -13,6 +14,7 @@ const handler: WebsocketHandler = (
1314 params
1415) => {
1516 expectType < SocketStream > ( connection ) ;
17+ expectType < Server > ( app . websocketServer ) ;
1618 expectType < { [ key : string ] : any } | undefined > ( params ) ;
1719} ;
1820
You can’t perform that action at this time.
0 commit comments