From ad34cff2d2a4e8777738efa30620800940b0e87c Mon Sep 17 00:00:00 2001 From: ivan-tymoshenko Date: Tue, 10 May 2022 19:08:16 +0300 Subject: [PATCH] Change lookup result type to any --- index.d.ts | 4 ++-- test/types/router.test-d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 40be3727..421b5d40 100644 --- a/index.d.ts +++ b/index.d.ts @@ -55,7 +55,7 @@ declare namespace Router { res: Res, params: { [k: string]: string | undefined }, store: any - ) => void; + ) => any; interface ConstraintStrategy { name: string, @@ -148,7 +148,7 @@ declare namespace Router { req: Req, res: Res, ctx?: Context - ): void; + ): any; find( method: HTTPMethod, diff --git a/test/types/router.test-d.ts b/test/types/router.test-d.ts index 80fd4efd..c2ad8b17 100644 --- a/test/types/router.test-d.ts +++ b/test/types/router.test-d.ts @@ -51,7 +51,7 @@ let http2Res!: Http2ServerResponse; expectType(router.off('GET', '/')) expectType(router.off(['GET', 'POST'], '/')) - expectType(router.lookup(http1Req, http1Res)) + expectType(router.lookup(http1Req, http1Res)) expectType | null>(router.find('GET', '/')) expectType | null>(router.find('GET', '/', {})) expectType | null>(router.find('GET', '/', {version: '1.0.0'})) @@ -107,7 +107,7 @@ let http2Res!: Http2ServerResponse; expectType(router.off('GET', '/')) expectType(router.off(['GET', 'POST'], '/')) - expectType(router.lookup(http2Req, http2Res)) + expectType(router.lookup(http2Req, http2Res)) expectType | null>(router.find('GET', '/', {})) expectType | null>(router.find('GET', '/', {version: '1.0.0', host: 'fastify.io'}))