/** * Permission specification — same shape used by route guards and * `hasPermission()`. */ export interface PermissionSpec { /** User needs at least one of these permissions */ any?: string[]; /** User needs every one of these permissions */ all?: string[]; } /** * A node in a navigation tree. Used as input to `filterByPermissions()` and * yielded by `walkTree()`. * * The two flag fields on the output side — `_forbidden` and * `_forbiddenClassName` — are attached by `filterByPermissions()` in * `mode: 'disable'`. They are NOT meant to be authored by hand on input * nodes. */ export interface NavTreeNode { /** Absolute route path the link navigates to. */ path: string; /** Human-readable label rendered in the menu. */ title?: string; /** * Permission spec required to access this node. When `inheritPermissions` * is enabled on the filter, ancestor permissions also apply. */ permissions?: PermissionSpec; /** * Unconditionally exclude this node from the rendered menu — same effect * in both `'hide'` and `'disable'` modes. Accepts a boolean literal or a * getter function. The getter receives the node itself and returns * `true` to hide. * * Reactive: any reactive state the getter reads (via `$state` / * `$derived` / `hasPermission()`) makes the filter result reactive when * called inside a `$derived` block. * * Bare name (no `is*` prefix) matches HTML's `