export type ITreeNode> = { id: string; label: string; data?: T; children?: ITreeNode[]; isParent?: boolean; }; export type IFlatTreeNode> = { node: ITreeNode; depth: number; hasChildren: boolean; parentId: string | undefined; }; export type ITreeNodeState = { isFocused: boolean; isExpanded: boolean; isSelected: boolean; isLoading: boolean; depth: number; hasChildren: boolean; }; /** * Flattens a tree into a visible list based on expansion state. * Only expanded nodes' children are included. * * Analogy (Naruto): unrolling a scroll — collapsed sections stay sealed, * expanded sections reveal their contents. */ export declare function flattenTree(nodes: ITreeNode[], expandedIds: ReadonlySet, depth?: number, parentId?: string | undefined): IFlatTreeNode[]; export declare function findParentId(flatNodes: IFlatTreeNode[], nodeId: string): string | undefined; export declare function findFirstChildId(flatNodes: IFlatTreeNode[], nodeId: string, expandedIds: ReadonlySet): string | undefined; export type IViewport = { fromIndex: number; toIndex: number; }; export declare function computeViewport(totalCount: number, focusedIndex: number, visibleCount: number, current: IViewport): IViewport; //# sourceMappingURL=tree-utils.d.ts.map