export type WindowRange = { /** First mounted index (inclusive). */ start: number; /** One past the last mounted index (exclusive). */ end: number; }; /** * Pure windowing math: given each section's height (px), the scroll offset, the * viewport height, and an overscan count, return the `[start, end)` index window * to mount. Robust to a zero viewport (a headless/pre-layout pass) — it then * mounts a small overscan window anchored at the item under `scrollTop` rather * than the whole list. */ export declare function computeWindowRange(heights: readonly number[], scrollTop: number, viewport: number, overscan: number): WindowRange; export type WindowedSections = { /** Attach to the scroll container. */ scrollRef: React.RefObject; /** The mounted window `[start, end)`. */ range: WindowRange; /** Prefix offsets: `offsets[i]` is the top px of section `i`; `offsets[count]` * is the total content height. */ offsets: number[]; /** Total content height (px) — set on the spacer so scroll length is stable. */ totalHeight: number; /** Report a MOUNTED section's real height (px) so the layout refines as async * content — e.g. Pierre's Shiki render — grows. Drive it from a ResizeObserver; * a zero/idle value is ignored so a headless pass keeps the estimate. */ measure: (index: number, height: number) => void; /** Scroll section `index` to the top of the pane (the rail-jump). */ scrollToIndex: (index: number) => void; }; /** * Variable-height section windowing over a scroll container. Seeds every section * to `estimateHeight(i)`, mounts only `range`, and refines heights from real * measurements (a no-op in a zero-layout headless pass, which keeps the estimate * — deterministic for tests). Pass a STABLE `estimateHeight` (wrap in useCallback). */ export declare function useWindowedSections(opts: { count: number; estimateHeight: (index: number) => number; overscan?: number | undefined; }): WindowedSections;