import type { ItemPosition } from "./layout"; import type { ScrollState } from "./types"; export interface VisibleRangeParams { /** * Number of items in the list. * * Passed separately because `positions` lags behind during the render that * follows an items change — the new items exist but have not been placed * yet, and they still have to be accounted for. */ count: number; /** Placement per index. Entries may be missing while a layout pass is pending. */ positions: ArrayLike; /** Measured height per index; holes fall back to `fallbackHeight`. */ heights: ArrayLike; scroll: ScrollState; /** Extra pixels kept rendered above and below the viewport. */ overscan: number; /** Height assumed for unmeasured items. Default: 0 */ fallbackHeight?: number; } /** * Determine which item indices intersect the viewport, plus the overscan * buffer, in container-relative coordinates. * * Kept separate from any framework so React, Vue, and the vanilla engine * share identical visibility semantics. * * Two kinds of item are reported visible regardless of geometry, because * mounting them is the only way to learn what they are: * * - **Unplaced** — the item list grew and the layout pass has not run yet. * - **Unmeasured, with no estimate** — there is no height to test against, and * an item that is never rendered is never measured. * * This is what keeps appending cheap. The previous design switched * virtualization off wholesale whenever anything was unmeasured, so adding one * item to a list of 5,000 re-rendered all 5,001. Now only the genuinely * unknown items are forced out, and supplying `estimatedItemHeight` removes * even those. */ export declare function computeVisibleIndices(params: VisibleRangeParams): Set; /** * Decide whether virtualization may take effect. * * Measurement state is deliberately not consulted: clipping an unmeasured item * is prevented per-item by {@link computeVisibleIndices}, which is what lets a * partially measured list stay virtualized instead of falling back to * rendering everything. */ export declare function canVirtualize(options: { virtualize: boolean; itemCount: number; }): boolean;