Files
clean-architecture-frontend…/src/contracts/route-runtime-contract.ts
T
2026-08-01 19:39:59 +09:00

51 lines
1.3 KiB
TypeScript

export type RouteCodecId = "none" | "NotFoundSplat";
export type RouteRuntimeDefinition = Readonly<{
routeId: string;
moduleId: string;
paramsCodec: RouteCodecId;
searchCodec: RouteCodecId;
}>;
const runtime = <Definition extends RouteRuntimeDefinition>(
value: Definition,
): Readonly<Definition> => Object.freeze(value);
export const PLATFORM_ROUTE_RUNTIME_CONTRACT = Object.freeze({
APP_HOME: runtime({
routeId: "APP_HOME",
moduleId: "home-page",
paramsCodec: "none",
searchCodec: "none",
}),
EXAMPLES_PLATFORM: runtime({
routeId: "EXAMPLES_PLATFORM",
moduleId: "platform-overview-page",
paramsCodec: "none",
searchCodec: "none",
}),
EXAMPLES_UI: runtime({
routeId: "EXAMPLES_UI",
moduleId: "ui-gallery-page",
paramsCodec: "none",
searchCodec: "none",
}),
EXAMPLES_STATES: runtime({
routeId: "EXAMPLES_STATES",
moduleId: "state-gallery-page",
paramsCodec: "none",
searchCodec: "none",
}),
EXAMPLES_AUTH: runtime({
routeId: "EXAMPLES_AUTH",
moduleId: "auth-example-page",
paramsCodec: "none",
searchCodec: "none",
}),
NOT_FOUND: runtime({
routeId: "NOT_FOUND",
moduleId: "not-found-page",
paramsCodec: "NotFoundSplat",
searchCodec: "none",
}),
});