Complete worked example
typescript
export const routes={roles:"/vacancies",news:"/news"} as const;
export type Route=keyof typeof routes;
export function path(route:Route):string{return routes[route];}
const selected=path("roles");- Reasoning
- A finite registry illustrates a deliberate public vocabulary; emitted imports must still match their runtime host.