/** The minimal node shape the projection reads; the adapters' own node types are supersets of it. */ export interface TreeColumnNode { value: string; disabled?: boolean | undefined; /** Declares a branch whose children have not loaded yet, so its column exists while still empty. */ hasChildren?: boolean | undefined; children?: readonly TreeColumnNode[] | undefined; } /** One rendered column: the sibling set at a single depth. */ export interface TreeColumn { /** The branch whose children this column lists, or `null` for the root column. */ parent: string | null; /** The column's nodes in collection order; empty while a lazy branch is still loading. */ nodes: readonly TreeColumnNode[]; } /** * The columns showing for an expanded set: the roots, then one column per expanded branch along a single open path. * * Columns are a chain, so at most one branch per depth can be open. An * `expanded` set naming two branches at the same depth is not an error: the * first in collection order wins and the rest are ignored, which keeps the * projection total and lets a consumer hand the same `expanded` array to * either layout. * * @param collection the root nodes, each carrying its own children * @param expanded every expanded node's value, in any order * @returns the columns left to right; always at least the root column */ export declare function treeColumns(collection: readonly TreeColumnNode[], expanded: Iterable): TreeColumn[]; /** * The chain of values from the root down to `value`, inclusive, or empty when the collection does not hold it. * * This is the expanded set that opens `value`'s own column: passing it to * {@link treeColumns} shows every ancestor's column and closes every branch off * the path. Dropping its last entry is the set that closes `value`'s column * instead, which is what moving back a column needs. * * @param collection the root nodes, each carrying its own children * @param value the node to reach */ export declare function pathTo(collection: readonly TreeColumnNode[], value: string): string[]; /** * The index of the column holding `value`, or `-1` when no showing column does. * * @param columns the projection {@link treeColumns} returned * @param value the node to locate */ export declare function columnIndexOf(columns: readonly TreeColumn[], value: string): number;