From 972f6945c280c74d733a6390f89102d148552ec2 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Fri, 10 Apr 2026 11:39:50 +0100 Subject: [PATCH] Fix types error --- dist/types/index.d.ts | 4 +++- package.json | 2 +- src/functions/server/handle-routes.ts | 1 + src/types/index.ts | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/types/index.d.ts b/dist/types/index.d.ts index 4ec66ab..bf2cfa6 100644 --- a/dist/types/index.d.ts +++ b/dist/types/index.d.ts @@ -295,9 +295,11 @@ export type GrabTSXModuleBatchMap = { tsx: string; page_file_path: string; }; -export type BunextAPIRouteHandler = (params: BunxRouteParams) => Promise | Response | T; export type BunextAPIRouteJSONRes = { bunext_api_route_res_options?: ResponseInit; +} & { + [k: string]: any; }; diff --git a/package.json b/package.json index 7d5ee1c..ede5cb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/bunext", - "version": "1.0.64", + "version": "1.0.65", "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 3d7592a..2ad50f9 100644 --- a/src/functions/server/handle-routes.ts +++ b/src/functions/server/handle-routes.ts @@ -1,4 +1,5 @@ import type { + APIResponseObject, BunextAPIRouteHandler, BunextServerRouteConfig, BunxRouteParams, diff --git a/src/types/index.ts b/src/types/index.ts index 55655ca..feabd46 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -341,11 +341,13 @@ export type GrabTSXModuleBatchMap = { }; export type BunextAPIRouteHandler< - T extends BunextAPIRouteJSONRes = BunextAPIRouteJSONRes & { + T extends BunextAPIRouteJSONRes = { [k: string]: any; }, > = (params: BunxRouteParams) => Promise | Response | T; export type BunextAPIRouteJSONRes = { bunext_api_route_res_options?: ResponseInit; +} & { + [k: string]: any; };