import { type VirtualItem } from '@tanstack/react-virtual'; import { type RefObject } from 'react'; export interface UseVirtualListOptions { /** Total number of items in the list */ count: number; /** Reference to the scrollable container element */ parentRef: RefObject; /** Height of each item in pixels (default: 36) */ estimateSize?: number; /** Number of extra items to render above/below viewport (default: 5) */ overscan?: number; /** Enable/disable virtualization (default: true) */ enabled?: boolean; } export interface UseVirtualListResult { /** Array of virtual items currently visible (plus overscan) */ virtualItems: VirtualItem[]; /** Total height of all items for scrollbar sizing */ totalSize: number; /** Scroll to a specific item index */ scrollToIndex: (index: number, options?: { align?: 'start' | 'center' | 'end' | 'auto'; }) => void; /** Measure element at index (for dynamic heights if needed) */ measureElement: (element: HTMLElement | null) => void; } /** * Hook for virtualizing a list of items, rendering only visible items in the DOM. * Wraps @tanstack/react-virtual with project-specific defaults. * * @example * ```tsx * const { virtualItems, totalSize } = useVirtualList({ * count: records.length, * parentRef: scrollContainerRef, * }) * ``` */ export declare function useVirtualList({ count, parentRef, estimateSize, overscan, enabled, }: UseVirtualListOptions): UseVirtualListResult; //# sourceMappingURL=useVirtualList.d.ts.map