// AUTO-GENERATED by `wrnexus dev` — do not edit.
// Typed routes: a compile-time map of every page path to its [param] types,
// plus an href() builder that fills params and rejects unknown paths.

export interface Routes {
  "/": Record<string, never>;
  "/architecture": Record<string, never>;
  "/getting-started": Record<string, never>;
  "/language": Record<string, never>;
  "/packages": Record<string, never>;
  "/packages/ai": Record<string, never>;
  "/packages/authz": Record<string, never>;
  "/packages/cli": Record<string, never>;
  "/packages/compiler": Record<string, never>;
  "/packages/core": Record<string, never>;
  "/packages/csr": Record<string, never>;
  "/packages/db": Record<string, never>;
  "/packages/dev-server": Record<string, never>;
  "/packages/encryption": Record<string, never>;
  "/packages/i18n": Record<string, never>;
  "/packages/jwt": Record<string, never>;
  "/packages/mobile": Record<string, never>;
  "/packages/native": Record<string, never>;
  "/packages/oauth": Record<string, never>;
  "/packages/pubsub": Record<string, never>;
  "/packages/queue": Record<string, never>;
  "/packages/reactive": Record<string, never>;
  "/packages/router": Record<string, never>;
  "/packages/ssr": Record<string, never>;
  "/packages/styles": Record<string, never>;
  "/packages/test": Record<string, never>;
  "/packages/tracking": Record<string, never>;
  "/packages/ui": Record<string, never>;
  "/packages/uploader": Record<string, never>;
  "/packages/validation": Record<string, never>;
}

export type RoutePath = keyof Routes;

export function href<P extends RoutePath>(
  path: P,
  ...args: Routes[P] extends Record<string, never> ? [] : [params: Routes[P]]
): string {
  const params = (args[0] ?? {}) as Record<string, string>;
  return String(path)
    .split("/")
    .map((seg) =>
      seg.startsWith("[") && seg.endsWith("]")
        ? encodeURIComponent(params[seg.slice(1, -1)] ?? "")
        : seg,
    )
    .join("/");
}
