import type { Key } from "react"; /** * A foldable range of rows. `start` is the header row that stays visible; * `start + 1 ..= end` are the rows a closed fold hides. Indices point into the * full row array, and `key` is the header row's key, so closed state survives * row changes that keep keys stable. */ export interface FoldRange { key: Key; start: number; end: number; } /** The visible projection of a full row array under a set of closed folds. */ export interface FoldView { /** Full-array index of each visible row, in order. */ visibleToSource: readonly number[]; /** Visible index of each full-array row, or `-1` when a closed fold hides it. */ sourceToVisible: readonly number[]; /** Hidden row count for each closed header, keyed by the header's visible index. */ hiddenCounts: ReadonlyMap; } /** * Project `rowCount` rows through the closed folds. A closed range hides its * body even when it sits inside another closed range; the outermost header * shown carries the count of every row hidden below it. */ export declare const computeFoldView: (rowCount: number, ranges: readonly FoldRange[], closedKeys: ReadonlySet) => FoldView; /** Ranges that contain `row` (header included), innermost first. */ export declare const foldsAt: (ranges: readonly FoldRange[], row: number) => readonly FoldRange[]; /** * Keys of the closed ranges that hide `row`: closed ranges whose body * (`start + 1 ..= end`) contains it. Opening them all makes `row` visible. */ export declare const closedFoldsHiding: (ranges: readonly FoldRange[], closedKeys: ReadonlySet, row: number) => Key[]; /** * The full-array row the cursor should rest on once `view` applies: `row` * itself when it stays visible, otherwise the nearest visible row before it, * which is the header of the outermost closed fold that hides it. */ export declare const visibleAnchorRow: (view: FoldView, row: number) => number; //# sourceMappingURL=fold-model.d.ts.map