Initial commit

This commit is contained in:
2023-10-29 19:28:07 +00:00
commit b0d0353ba7
25 changed files with 7930 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
import type { RouteList } from "./routelist.ts"
type RouteUrl = RouteList[number]["url"];
type HttpMethod = RouteList[number]["method"];
type Route<M extends HttpMethod, U extends RouteUrl> = Extract<RouteList[number], {url: U, method: M}>;
export type RoutePayload<M extends HttpMethod, U extends RouteUrl> = Parameters<Route<M, U>["handler"]>[0]["payload"];
export type RouteResponse<M extends HttpMethod, U extends RouteUrl> = Awaited<ReturnType<Route<M, U>["handler"]>>;