/** * Options for building a URL via `$path()`. * * At the source level, `to` is a loose `string`. The generated * `declare module` override narrows it to a union of actual route IDs. */ export type RouteOptions = { /** The route path to navigate to (e.g. `"/about"` or `"/blog/[slug]"`). */ to: string; /** Dynamic params for the route (e.g. `{ slug: "hello" }`). */ params?: Record; /** Locale prefix for i18n (e.g. `"fr"` → `/fr/about`). */ locale?: string; /** Search/query params (e.g. `{ page: "2" }` → `?page=2`). */ search?: Record; /** URL hash fragment (e.g. `"comments"` → `#comments`). */ hash?: string; }; /** * Builds a fully-resolved URL string from route options. * * Steps: replace `[param]` segments → prepend locale → append search → append hash. * * @example * $path({ to: "/about" }) // → "/about" * * @example * $path({ to: "/blog/[slug]", params: { slug: "hello" }, locale: "fr" }) * // → "/fr/blog/hello" * * @example * $path({ to: "/about", search: { ref: "nav" }, hash: "team" }) * // → "/about?ref=nav#team" */ export declare function $path(opts: RouteOptions): string; //# sourceMappingURL=path.d.ts.map