export interface UseVirtualizationOptions { /** Total number of items */ itemCount: number; /** Height of each item in pixels */ itemHeight: number; /** Height of the visible container in pixels */ containerHeight: number; /** Number of items to render outside visible area (default: 3) */ overscan?: number; /** Whether virtualization is enabled (default: true when itemCount > threshold) */ enabled?: boolean; /** Threshold for enabling virtualization (default: 50) */ threshold?: number; } export interface UseVirtualizationResult { /** First item index to render */ startIndex: number; /** Last item index to render (inclusive) */ endIndex: number; /** Total height of all items (for scroll container) */ totalHeight: number; /** Y offset for positioning visible items */ offsetY: number; /** Number of visible items */ visibleCount: number; /** Whether virtualization is active */ isVirtualized: boolean; /** Scroll event handler - attach to container's onScroll */ handleScroll: (e: React.UIEvent) => void; /** Current scroll position */ scrollTop: number; /** Container style for the scroll area */ containerStyle: React.CSSProperties; /** Inner wrapper style (total height) */ innerStyle: React.CSSProperties; /** Content style (transform offset) */ contentStyle: React.CSSProperties; } /** * Hook for virtualizing large lists. * Only renders items that are visible in the viewport plus overscan buffer. */ export default function useVirtualization(options: UseVirtualizationOptions): UseVirtualizationResult;