/** * vapor-chamber-router — menu + breadcrumb projections of the route table. * * The table already carries everything a navigation UI needs; these builders * only project it — nothing here is authored client-side: * · `meta.menu` (an INTEGER — the server-owned menu position; row order in * the table is match-specificity order, so the menu has its own column) * marks a row as a menu entry. Menu rows need `meta.title` (an i18n key — * translating is the view's job) and a static path: a required `:param` * has no fixed href and is rejected. Group rows may be menued too — they * become href-less section nodes. * · Nesting follows the parent chain: an entry's menu parent is its nearest * menued ancestor. * · Permission filtering is the SERVER's job (visibleTo before delivery) — * what the table holds is what the user may see, so the projection is * permission-correct by construction. * · active/exact use pathActivity — the SAME semantics as `data-active` * stamping, so Blade menus and Vue menus always agree. * * Like table validation, the menu contract is enforced loudly in dev (and, by * convention, by the route generator at export); production trusts the * generator. */ import type { RouteLocation, TableRecord } from './types'; export type MenuItem = { name: string; /** `meta.title` — an i18n KEY; translate in the view. */ title: string; /** Absolute href (base included) — null for group rows (section nodes). */ href: string | null; meta: Record; /** Same semantics as data-active stamping; a parent also lights up when * any of its children is active. */ active: boolean; exactActive: boolean; children: readonly MenuItem[]; }; export type Breadcrumb = { name: string; /** `meta.title` — an i18n KEY; translate in the view. */ title: string; /** Absolute href; null when the crumb is not a link target (group rows, * ancestors whose params the current location cannot supply). */ href: string | null; /** True on the last crumb — the page being shown. */ current: boolean; meta: Record; }; /** Rows flagged `meta.menu`, position-sorted, nested by nearest menued * ancestor, active-stamped against `currentPath`. */ export declare function buildMenu(records: readonly TableRecord[], currentPath: string, base?: string): MenuItem[]; /** The current route's parent chain, filtered to rows with a `meta.title`, * root-first — the page itself is the last crumb. */ export declare function buildBreadcrumbs(location: RouteLocation, base?: string): Breadcrumb[]; //# sourceMappingURL=menu.d.ts.map