From ba030822f61637fd788d67c27834a1505e2bccc8 Mon Sep 17 00:00:00 2001 From: istarkov Date: Sat, 6 Jul 2024 07:53:08 +0300 Subject: [PATCH] Revert types fix the call --- src/AutoRouter.ts | 2 +- src/types/AutoRouterOptions.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/AutoRouter.ts b/src/AutoRouter.ts index 04da2fa..9055226 100644 --- a/src/AutoRouter.ts +++ b/src/AutoRouter.ts @@ -24,7 +24,7 @@ export const AutoRouter = < catch: error, finally: [ // @ts-ignore - (r: any, ...args) => r ?? missing(r, ...args), + (r: any, ...args) => r ?? missing(...args), format, ...f, ], diff --git a/src/types/AutoRouterOptions.ts b/src/types/AutoRouterOptions.ts index c373ecd..adfdfb3 100644 --- a/src/types/AutoRouterOptions.ts +++ b/src/types/AutoRouterOptions.ts @@ -1,7 +1,11 @@ +import { RequestHandler } from './RequestHandler' import { ResponseHandler } from './ResponseHandler' import { RouterOptions } from './RouterOptions' -export type AutoRouterOptions = { - missing?: ResponseHandler +export type AutoRouterOptions< + RequestType, + Args extends any[], +> = { + missing?: RequestHandler format?: ResponseHandler -} & RouterOptions +} & RouterOptions \ No newline at end of file