From d8245d25289d8fc6e854550829291950bfe7e5d5 Mon Sep 17 00:00:00 2001 From: gvgvli Date: Tue, 19 Dec 2023 15:31:01 +0800 Subject: [PATCH] fix: generic type error of `RouteShorthandMethod` --- types/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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<