import { TreeVisitOptions } from './tree-visit.mjs'; import { TreeNode, TreeCollectionOptions, TreeSkipOptions, IndexPath, DescendantOptions, FlatTreeNode, FilePathTreeNode, TreeCollectionMethods } from './types.mjs'; declare class TreeCollection { private options; rootNode: T; constructor(options: TreeCollectionOptions); isEqual: (other: TreeCollection) => boolean; getNodeChildren: (node: T) => T[]; private resolveIndexPath; private resolveNode; getNodeChildrenCount: (node: T) => number | undefined; getNodeValue: (node: T) => string; getNodeDisabled: (node: T) => boolean; stringify: (value: string) => string | null; stringifyNode: (node: T) => string; getFirstNode: (rootNode?: T, opts?: TreeSkipOptions) => T | undefined; getLastNode: (rootNode?: T, opts?: TreeSkipOptions) => T | undefined; at: (indexPath: IndexPath) => T | undefined; findNode: (value: string, rootNode?: T) => T | undefined; findNodes: (values: string[], rootNode?: T) => T[]; sort: (values: string[]) => string[]; /** * Get the index path for a value or value path. * @param value - A single value string to find in the tree * @returns The index path to the node, or undefined if not found */ getIndexPath(value: string): IndexPath | undefined; /** * Get the index path for a value path (array of values representing ancestors). * @param valuePath - An array of values representing the path from root to target * @returns The index path to the node */ getIndexPath(valuePath: string[]): IndexPath; getValue: (indexPath: IndexPath) => string | undefined; getValuePath: (indexPath: IndexPath | undefined) => string[]; getDepth: (value: string) => number; isSameNode: (node: T, other: T) => boolean; isRootNode: (node: T) => boolean; contains: (parentIndexPath: IndexPath, valueIndexPath: IndexPath) => boolean; getNextNode: (value: string, opts?: TreeSkipOptions) => T | undefined; getPreviousNode: (value: string, opts?: TreeSkipOptions) => T | undefined; getParentNodes: (valueOrIndexPath: string | IndexPath) => T[]; getDescendantNodes: (valueOrIndexPath: string | IndexPath, options?: DescendantOptions) => T[]; getDescendantValues: (valueOrIndexPath: string | IndexPath, options?: DescendantOptions) => string[]; private getParentIndexPath; getParentNode: (valueOrIndexPath: string | IndexPath) => T | undefined; visit: (opts: Omit, "getChildren"> & TreeSkipOptions) => void; getPreviousSibling: (indexPath: IndexPath) => T | undefined; getNextSibling: (indexPath: IndexPath) => T | undefined; getSiblingNodes: (indexPath: IndexPath) => T[]; getValues: (rootNode?: T) => string[]; private isValidDepth; isBranchNode: (node: T) => boolean; getBranchValues: (rootNode?: T, opts?: TreeSkipOptions & { depth?: number | ((nodeDepth: number) => boolean) | undefined; }) => string[]; flatten: (rootNode?: T) => Array>; private _create; private _insert; copy: (rootNode: T) => TreeCollection; private _replace; private _move; private _remove; replace: (indexPath: IndexPath, node: T) => TreeCollection; remove: (indexPaths: IndexPath[]) => TreeCollection; insertBefore: (indexPath: IndexPath, nodes: T[]) => TreeCollection | undefined; insertAfter: (indexPath: IndexPath, nodes: T[]) => TreeCollection | undefined; move: (fromIndexPaths: IndexPath[], toIndexPath: IndexPath) => TreeCollection; filter: (predicate: (node: T, indexPath: IndexPath) => boolean) => TreeCollection; toJSON: () => string[]; } declare function flattenedToTree(nodes: Array>, options?: TreeCollectionMethods): TreeCollection; declare function filePathToTree(paths: string[]): TreeCollection; export { TreeCollection, filePathToTree, flattenedToTree };