diff --git a/types/index.d.ts b/types/index.d.ts index 697ad9b..b2b5546 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -41,12 +41,13 @@ declare module 'fastify' { RawRequest extends RawRequestDefaultExpression = RawRequestDefaultExpression, RawReply extends RawReplyDefaultExpression = RawReplyDefaultExpression, TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault, + Logger extends FastifyBaseLogger = FastifyBaseLogger, > { - ( + ( path: string, - opts: RouteShorthandOptions & { websocket: true }, // this creates an overload that only applies these different types if the handler is for websockets - handler?: fastifyWebsocket.WebsocketHandler - ): FastifyInstance; + opts: RouteShorthandOptions & { websocket: true }, // this creates an overload that only applies these different types if the handler is for websockets + handler?: fastifyWebsocket.WebsocketHandler + ): FastifyInstance; } interface RouteOptions< diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 7ace0c6..8722875 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -30,6 +30,7 @@ app.get('/websockets-via-inferrence', { websocket: true }, async function (conne expectType(app.websocketServer); expectType>(request) expectType(request.ws); + expectType(request.log); }); const handler: WebsocketHandler = async (connection, request) => {