new format wip

This commit is contained in:
Dylan Pizzo
2026-06-10 21:47:30 -04:00
parent 07595c31ef
commit 876404d8f5
45 changed files with 10893 additions and 144129 deletions
+13 -6
View File
@@ -1,11 +1,18 @@
import type { RouteList } from "./routelist.ts"
// import type { RouteList } from "./routelist.ts";
type RouteUrl = RouteList[number]["url"];
// type RouteUrl = RouteList[number]["url"];
type HttpMethod = RouteList[number]["method"];
// type HttpMethod = RouteList[number]["method"];
type Route<M extends HttpMethod, U extends RouteUrl> = Extract<RouteList[number], {url: U, method: M}>;
// 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 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"]>>;
// export type RouteResponse<M extends HttpMethod, U extends RouteUrl> = Awaited<
// ReturnType<Route<M, U>["handler"]>
// >;