import { Equal } from "./types/utils.js"; import { Pages } from "./types/register.js"; //#region lib/href.d.ts type Args = { [K in keyof Pages]: ToArgs }; type ToArgs> = Equal extends true ? [] : Partial extends Params ? [Params] | [] : [Params]; /** * Returns a resolved URL path for the specified route. * * Param values are percent-encoded for use in a path segment: characters that * would change the URL structure (`/`, `?`, `#`, `%`, whitespace, non-ASCII) * are escaped, while characters that RFC 3986 allows literally in a path * segment (`$ & + , ; = : @`) are kept as-is. Note this differs from query-string * encoding (`encodeURIComponent`/`URLSearchParams`), where those characters are * delimiters and must be escaped. Splat (`*`) values are encoded per segment, * preserving `/` separators. * * See [RFC 3986 ยง3.3](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3) * * @example * const h = href("/:lang?/about", { lang: "en" }) * // -> `/en/about` * * * * @public * @category Utils * @mode framework * @param path The route path to resolve * @param args The route params to use when resolving the path * @returns The resolved URL path */ declare function href(path: Path, ...args: Args[Path]): string; //#endregion export { href };