booru-api/types/routes.d.ts
2024-12-28 09:13:34 -05:00

20 lines
385 B
TypeScript

type RouteDef = {
method: string;
accepts: string | null;
returns: string;
needsBody?: "multipart" | "json";
};
type Query = Record<string, string>;
type Params = Record<string, string>;
type RouteModule = {
handler: (
request: Request,
server: BunServer,
requestBody: unknown,
query: Query,
params: Params,
) => Promise<Response> | Response;
routeDef: RouteDef;
};