/** * Utilities for building and rendering tree structures. */ /** * Represents an item that can be placed in a tree structure. */ export interface TreeItem { _id: number; title: string; count: number; parent?: { $id: number; } | null; } /** * Tree node for hierarchical display. */ export interface TreeNode { item: T; children: TreeNode[]; } /** * Rendered tree row with display string and item data. */ export interface TreeRow { /** Display string with tree characters and icon (no ANSI styling) */ tree: string; /** Original item ID */ _id: number; /** Item count */ count: number; } /** * Build a tree structure from flat item lists. * Handles deduplication if items appear in both lists. * * @param rootItems - Items at root level (no parent) * @param childItems - Items with parents * @returns Array of root TreeNodes with children populated */ export declare function buildTree(rootItems: T[], childItems: T[]): TreeNode[]; /** * Render tree nodes as formatted rows with tree characters. * Returns plain text without ANSI styling - styling is applied by formatters. * * @param nodes - Tree nodes to render * @param icon - Icon to display before each title (default: 📂) * @returns Array of TreeRow objects */ export declare function renderTree(nodes: TreeNode[], icon?: string): TreeRow[]; //# sourceMappingURL=tree.d.ts.map