Fix types error

This commit is contained in:
Benjamin Toby 2026-04-10 11:42:22 +01:00
parent 972f6945c2
commit 349b99bacf
4 changed files with 11 additions and 4 deletions

View File

@ -297,7 +297,7 @@ export type GrabTSXModuleBatchMap = {
};
export type BunextAPIRouteHandler<T extends BunextAPIRouteJSONRes = {
[k: string]: any;
}> = (params: BunxRouteParams) => Promise<Response | T> | Response | T;
}> = (params: BunxRouteParams) => Promise<Response | (T & Pick<BunextAPIRouteJSONRes, "bunext_api_route_res_options">)> | Response | (T & Pick<BunextAPIRouteJSONRes, "bunext_api_route_res_options">);
export type BunextAPIRouteJSONRes = {
bunext_api_route_res_options?: ResponseInit;
} & {

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/bunext",
"version": "1.0.65",
"version": "1.0.67",
"main": "dist/index.js",
"module": "index.ts",
"dependencies": {

View File

@ -1,5 +1,4 @@
import type {
APIResponseObject,
BunextAPIRouteHandler,
BunextServerRouteConfig,
BunxRouteParams,

View File

@ -344,7 +344,15 @@ export type BunextAPIRouteHandler<
T extends BunextAPIRouteJSONRes = {
[k: string]: any;
},
> = (params: BunxRouteParams) => Promise<Response | T> | Response | T;
> = (
params: BunxRouteParams,
) =>
| Promise<
| Response
| (T & Pick<BunextAPIRouteJSONRes, "bunext_api_route_res_options">)
>
| Response
| (T & Pick<BunextAPIRouteJSONRes, "bunext_api_route_res_options">);
export type BunextAPIRouteJSONRes = {
bunext_api_route_res_options?: ResponseInit;