/** * Base interface for tree nodes. Consumers extend this with additional fields. */ export interface TreeNodeBase { id: string; name: string; path: string; type: 'file' | 'folder'; sortOrder?: number; children?: TreeNodeBase[]; } /** * Format a document name for display: remove .md extension and capitalize. */ export declare function formatDocName(name: string): string; /** * Sort children: README first, then folders, then files — each group by sort_order then alphabetical. * Recurses into folder children to ensure consistent ordering at all levels. */ export declare function sortTreeChildren(nodes: TNode[]): TNode[]; /** * Build a hierarchical document tree from a flat list of records. * * 3-pass algorithm: * 1. Create node map from flat records using the provided `mapFn` * 2. Build parent-child hierarchy using `getParentPath` * 3. Sort children (folders first, README, then others) */ export declare function buildDocumentTree(docs: TDoc[], mapFn: (doc: TDoc) => TNode, getParentPath: (doc: TDoc) => string | null, getPath: (doc: TDoc) => string): TNode[]; //# sourceMappingURL=tree-builder.d.ts.map