import { NavItem } from './types'; export declare const NAV_MORE_ID_PREFIX = "__nav_more__:"; export type NavOverrideMap = Record; export interface ApplyNavVisibilityOptions { /** * Layer-1 permission checker ("resource:action"). Omit to skip capability * filtering (permissions still loading, or shell without RBAC). */ hasPermission?: (permission: string) => boolean; /** * The active surface's default-visible item ids. `null`/`undefined` means * no curation (Everything) — every permitted item is shown. */ surfaceVisibleItems?: readonly string[] | null; /** Per-item label overrides from the surface (persona vocabulary). */ labelOverrides?: Record; /** Per-item user overrides; win over the surface defaults. */ overrides?: NavOverrideMap; /** Label factory for the "N more…" reveal rows. */ moreLabel?: (count: number) => string; } export interface NavVisibilityResult { items: NavItem[]; /** Count of soft-hidden items (collapsed behind "N more…" rows). */ softHiddenCount: number; /** Count of hard-hidden (RBAC-removed) items. */ hardHiddenCount: number; } /** * Layer 1: recursively remove items the caller's role cannot use. A failing * parent removes its whole subtree. A passing parent keeps rendering even if * every child was removed, as long as it has its own destination. */ export declare function applyPermissionFilter(items: NavItem[], hasPermission: ((permission: string) => boolean) | undefined, counter?: { removed: number; }): NavItem[]; /** * Layers 2–3: apply the active surface's visibility defaults plus the user's * per-item overrides. Soft-hidden top-level items collapse into one * "N more…" row per nav group; soft-hidden children collapse into a nested * "N more…" row inside their parent. */ export declare function applySurfaceVisibility(items: NavItem[], options: Pick): { items: NavItem[]; softHiddenCount: number; }; /** * Full pipeline: Layer 1 (hard) then Layers 2–3 (soft). */ export declare function applyNavVisibility(items: NavItem[], options: ApplyNavVisibilityOptions): NavVisibilityResult; /** * Effective visibility of a single (permitted) item for the Customize dialog: * what the user currently sees, combining surface defaults and overrides. */ export declare function isItemEffectivelyShown(item: NavItem, parentShown: boolean, surfaceVisibleItems: readonly string[] | null | undefined, overrides: NavOverrideMap): boolean; //# sourceMappingURL=navVisibility.d.ts.map