import type { TreeNode } from './lib/types.js'; /** 10,000 file rows render cheaply but stand 300,000px tall, burying the folder's * next sibling. Directories are never held back. */ export declare const TREE_FILE_CAP = 50; /** One visible line in the sidebar tree. */ export interface TreeRow { kind: 'node' | 'skeleton' | 'more'; /** Non-node rows suffix the parent path after a NUL, which object keys effectively * never contain; nothing is derived from the key, so a collision only warns. */ key: string; node: TreeNode; /** Roots are 0. Drives indent and aria-level (which is 1-based). */ depth: number; posInSet: number; /** The true sibling count, which aria-setsize wants even when the cap shows fewer. */ setSize: number; isExpanded: boolean; /** `more` rows only: files held back by the cap, 0 when only pages remain. */ hiddenFiles?: number; } interface FlattenTreeOptions { loadingPaths?: ReadonlySet; incompletePaths?: ReadonlySet; /** Absent means `TREE_FILE_CAP`. */ fileLimits?: ReadonlyMap; } /** Flattens the tree to exactly the rows that should be on screen, so the sidebar * can be windowed and keyboard navigation can move by index instead of by DOM. */ export declare function flattenTreeRows(roots: TreeNode[], parentToChildrenMap: Record, expandedPaths: ReadonlySet, options?: FlattenTreeOptions): TreeRow[]; export declare function nextFileLimit(current: number | undefined): number; /** Index of `path` among the visible rows, or -1. */ export declare function findRowIndex(rows: readonly TreeRow[], path: string): number; /** The next selectable row in `direction`, skipping skeleton and more rows. */ export declare function stepRow(rows: readonly TreeRow[], from: number, direction: 1 | -1): TreeRow | undefined; /** The row's parent: the nearest row above it one level up, or undefined at a root. */ export declare function parentRow(rows: readonly TreeRow[], index: number): TreeRow | undefined; /** An open folder's first child row, or undefined when it shows none yet. */ export declare function firstChildRow(rows: readonly TreeRow[], index: number): TreeRow | undefined; /** The first or last selectable row, for Home and End. */ export declare function edgeRow(rows: readonly TreeRow[], edge: 'first' | 'last'): TreeRow | undefined; export {};