Update API routes function

This commit is contained in:
2026-04-10 11:34:22 +01:00
parent 7fb1784b95
commit 6477f446d1
5 changed files with 56 additions and 28 deletions
+11 -6
View File
@@ -142,12 +142,7 @@ export type APIResponseObject<
};
export type BunextServerRouteConfig = {
maxRequestBodyMB?: number;
};
export type PageDistGenParams = {
pageName: string;
page_file: string;
max_request_body_mb?: number;
};
export type LivePageDistGenParams = {
@@ -344,3 +339,13 @@ export type GrabTSXModuleBatchMap = {
tsx: string;
page_file_path: string;
};
export type BunextAPIRouteHandler<
T extends BunextAPIRouteJSONRes = BunextAPIRouteJSONRes & {
[k: string]: any;
},
> = (params: BunxRouteParams) => Promise<Response | T> | Response | T;
export type BunextAPIRouteJSONRes = {
bunext_api_route_res_options?: ResponseInit;
};