/** * apply-sidebar-layout — pure overlay of an org sidebar layout onto a live * catalog of leaves. Mirrors ops `services.ApplySidebarLayout` (Go). See * CONTRACT-ORG-SIDEBAR-LAYOUT.md. */ export type SidebarNodeType = 'group' | 'folder' | 'leaf'; export interface SidebarLayoutNode { type: SidebarNodeType; key?: string; title?: string; icon?: string; ref?: string; hidden?: boolean; children?: SidebarLayoutNode[]; } export interface SidebarLayoutDoc { version?: number; tree: SidebarLayoutNode[]; } export interface CatalogLeaf { ref: string; title: string; url: string; icon?: string; /** Optional alternate refs that resolve to the same leaf. */ aliases?: string[]; } export interface AppliedNavItem { title: string; url: string; icon?: string; ref?: string; folderKey?: string; items?: AppliedNavItem[]; } export interface AppliedNavGroup { title: string; icon?: string; items: AppliedNavItem[]; } /** Normalize a nav URL/path for stable refs. */ export declare function normalizeNavPath(raw: string): string; export declare function coreRefKey(url: string): string; export declare function addonModelRefKey(addonKey: string, table: string, query?: string): string; export declare function addonUrlRefKey(addonKey: string, path: string): string; export declare function urlRefKey(url: string): string; export declare function folderAccessCapability(folderKey: string): string; /** * Pick the best stable ref for a live nav leaf. * Prefer addon-aware forms when metadata is known; fall back to url:/core:. */ export declare function leafRefFor(url: string, meta?: { addonKey?: string; model?: string; }): string; /** * Apply an org layout onto a catalog. Returns `null` when the tree is empty * (caller keeps the default merge). */ export declare function applySidebarLayout(catalog: CatalogLeaf[], tree: SidebarLayoutNode[] | undefined | null): AppliedNavGroup[] | null; /** Collect folder keys from a tree (for permissions catalog). */ export declare function collectFolderKeys(tree: SidebarLayoutNode[]): string[]; export declare function slugifyFolderKey(title: string): string; export declare function isValidFolderKey(key: string): boolean; /** * Build a default layout tree from the live nav groups (one group node per * section, leaves + existing collapsibles as folders). Used by the editor * "start from current sidebar" action. */ export declare function layoutTreeFromNavGroups(groups: Array<{ title: string; items: Array<{ title: string; url: string; icon?: string; items?: Array<{ title: string; url: string; icon?: string; items?: unknown[]; }>; folderKey?: string; ref?: string; }>; }>, refFor?: (url: string) => string): SidebarLayoutNode[]; //# sourceMappingURL=apply-sidebar-layout.d.ts.map