/** * Tree building module - converts flat file list to hierarchical tree */ import type { TreeNode } from '../types/index.js'; export declare class TreeBuilder { /** * Build hierarchical tree structure from flat file list * @param files - Array of file paths relative to root * @param rootName - Name of the root directory (default: 'root') * @returns Root tree node with nested children */ static buildTree(files: string[], rootName?: string): TreeNode; /** * Add a single file path to the tree structure * @param root - Root tree node * @param filePath - File path to add (using POSIX separators) */ private static addFileToTree; /** * Recursively sort tree children (directories first, then files, alphabetically) * @param node - Tree node to sort */ private static sortTreeChildren; /** * Get flat list of all files in tree * @param node - Root tree node * @param basePath - Base path for relative paths (default: empty) * @returns Array of file paths */ static getFilesFromTree(node: TreeNode, basePath?: string): string[]; /** * Count files and directories in tree * @param node - Tree node to count * @returns Object with file and directory counts */ static countNodes(node: TreeNode): { files: number; directories: number; }; /** * Find a node in the tree by path * @param root - Root tree node * @param targetPath - Path to find (using POSIX separators) * @returns Found node or undefined */ static findNodeByPath(root: TreeNode, targetPath: string): TreeNode | undefined; } //# sourceMappingURL=tree-builder.d.ts.map