/**
* Generic virtualized list component for ink-terminal.
*
* Wraps the useVirtualScroll hook into a declarative component API.
* Renders only items in viewport + overscan, using spacer Boxes to maintain
* scroll height. Works with any ScrollBox.
*
* Usage:
* ```tsx
*
* item.id}
* renderItem={(item, index) => }
* />
*
* ```
*/
import React, { type RefObject } from 'react';
import type { ScrollBoxHandle } from '../components/ScrollBox.js';
import { type VirtualScrollResult } from '../hooks/use-virtual-scroll.js';
type VirtualListProps = {
/** Array of items to render. */
items: readonly T[];
/** Ref to the parent ScrollBox handle. */
scrollRef: RefObject;
/** Terminal column count. Triggers height cache scaling on change. */
columns: number;
/** Extract a unique key from each item. Must be stable across renders. */
itemKey: (item: T, index: number) => string;
/** Render function for each visible item. */
renderItem: (item: T, index: number) => React.ReactNode;
/**
* Optional ref for accessing the VirtualScrollResult imperatively.
* Useful for scrollToIndex, getItemTop, etc.
*/
resultRef?: React.MutableRefObject;
};
/**
* A generic virtualized list that renders only visible items inside a ScrollBox.
*
* This component manages:
* - Mounting only items in viewport + overscan (80 rows above/below)
* - Height measurement and caching via Yoga layout
* - Top/bottom spacers to maintain scroll position
* - Slide cap (25 items/commit) for smooth fast scrolling
* - Column-change scaling for terminal resize
*/
export declare function VirtualList({ items, scrollRef, columns, itemKey, renderItem, resultRef, }: VirtualListProps): React.ReactNode;
export {};
//# sourceMappingURL=VirtualList.d.ts.map