diff --git a/dist/types/index.d.ts b/dist/types/index.d.ts index bf2cfa6..055e097 100644 --- a/dist/types/index.d.ts +++ b/dist/types/index.d.ts @@ -297,7 +297,7 @@ export type GrabTSXModuleBatchMap = { }; export type BunextAPIRouteHandler = (params: BunxRouteParams) => Promise | Response | T; +}> = (params: BunxRouteParams) => Promise)> | Response | (T & Pick); export type BunextAPIRouteJSONRes = { bunext_api_route_res_options?: ResponseInit; } & { diff --git a/package.json b/package.json index ede5cb3..ee5e790 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/bunext", - "version": "1.0.65", + "version": "1.0.67", "main": "dist/index.js", "module": "index.ts", "dependencies": { diff --git a/src/functions/server/handle-routes.ts b/src/functions/server/handle-routes.ts index 2ad50f9..3d7592a 100644 --- a/src/functions/server/handle-routes.ts +++ b/src/functions/server/handle-routes.ts @@ -1,5 +1,4 @@ import type { - APIResponseObject, BunextAPIRouteHandler, BunextServerRouteConfig, BunxRouteParams, diff --git a/src/types/index.ts b/src/types/index.ts index feabd46..2675c1d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -344,7 +344,15 @@ export type BunextAPIRouteHandler< T extends BunextAPIRouteJSONRes = { [k: string]: any; }, -> = (params: BunxRouteParams) => Promise | Response | T; +> = ( + params: BunxRouteParams, +) => + | Promise< + | Response + | (T & Pick) + > + | Response + | (T & Pick); export type BunextAPIRouteJSONRes = { bunext_api_route_res_options?: ResponseInit;