import { type TreeNode } from '../tree/tree'; import { type Maybe } from '../value/maybe.type'; import { type SlashPathDetails } from './path'; /** * A value that has a corresponding SlashPathDetails value. */ export type SlashPathDirectoryTreeNodeValue = { readonly value: T; readonly slashPathDetails: SlashPathDetails; }; /** * A tree node containing a value with slash path details. */ export type SlashPathDirectoryTreeNode = SlashPathDirectoryTreeNodeValue> = TreeNode; /** * Root of a slash path directory tree. Has children but no value of its own. */ export type SlashPathDirectoryTreeRoot = SlashPathDirectoryTreeNodeValue> = Omit, 'value'>; export interface SlashPathDirectoryTreeOptions { /** * Whether or not to include node values in the tree if their parent folders do not appear in the tree. * * If true, these nodes will be added to the root of the tree. * * Defaults to false */ readonly includeChildrenWithMissingParentFolder?: Maybe; } /** * Builds a directory tree structure from a flat list of node values based on their slash path hierarchy. * * Nodes are organized by their path parts, with each part becoming a level in the tree. * Typed files (files with extensions) are added as children but cannot serve as parent folders. * * @param nodeValues - Flat list of values with associated slash path details. * @param options - Optional configuration for tree building behavior. * @returns The root node of the constructed directory tree. */ export declare function slashPathDirectoryTree = SlashPathDirectoryTreeNodeValue>(nodeValues: V[], options?: SlashPathDirectoryTreeOptions): SlashPathDirectoryTreeRoot;