server/server/api/routes.type.ts

16 lines
427 B
TypeScript
Raw Normal View History

import type { MatchedRoute } from "bun";
2024-04-07 06:16:54 +02:00
import type { Config } from "config-manager";
import type { AuthData } from "~database/entities/User";
export type RouteHandler<T> = (
2024-04-07 07:30:49 +02:00
req: Request,
matchedRoute: MatchedRoute,
extraData: {
auth: AuthData;
parsedRequest: Partial<T>;
configManager: {
getConfig: () => Promise<Config>;
};
},
) => Response | Promise<Response>;