/** * vapor-chamber-router — the route table. * * Rows (generator-emitted, server-sorted by priority) → compiled table. * Everything static is precomputed here once: parent chain, renderable * chain, load chain, merged query defs, name map. Hot paths never derive. * * The generator is trusted — duplicate-name / unknown-parent validation runs * in dev only; production assumes well-formed rows the same way it assumes a * valid migration. */ import type { RouteParams, RouteRecord, Segment, TableRecord } from './types'; export type RouteTable = { records: readonly TableRecord[]; /** Resolve a decoded path (no query/hash) to the first matching record. */ resolve: (path: string) => { record: TableRecord; params: RouteParams; } | null; getRecord: (name: string) => TableRecord | undefined; /** Interpolate params into a record's pattern. */ buildPath: (record: TableRecord, params?: RouteParams) => string; }; /** Compile one path pattern into segments + a matching RegExp. */ /** * Render a compiled record's segments into a path, or report the first * required param the caller failed to supply. * * Shared because there are exactly two callers and they differ only in what a * missing param MEANS: `buildPath` throws (a link the app asked for and cannot * build is a bug), while breadcrumb projection yields a non-linking crumb (an * ancestor the current URL simply cannot address is normal). Keeping one copy * of the walk keeps route-URL construction from drifting between the two — * which in a router is precisely where a subtle mismatch would hide. */ export declare function renderSegments(segments: readonly Segment[], params: RouteParams): { path: string; missing?: undefined; } | { path?: undefined; missing: string; }; export declare function compilePath(path: string): { segments: Segment[]; re: RegExp; keys: string[]; }; export declare function createRouteTable(rows: readonly RouteRecord[]): RouteTable; //# sourceMappingURL=table.d.ts.map