import { ConversationStreamKey } from './types'; export interface PositionCache { /** * Replaces the ordered key list; measured heights survive by key, but only * for keys still present (plus `retain`). Pruning here is what keeps a * reused instance honest when the host swaps datasets: ids that repeat * across datasets ("user-1" in every thread) must not inherit another * dataset's measurements. `retain` shields the live row, which is measured * before its key ever appears in this list. */ syncKeys: (keys: ConversationStreamKey[], retain?: ConversationStreamKey | null) => void; /** * Records a measured height and returns the delta against what the layout * previously assumed — the caller compensates scrollTop with it when the * item sits above the viewport. */ setHeight: (key: ConversationStreamKey, height: number) => number; heightOf: (key: ConversationStreamKey) => number; /** Top offset of the item at `index`; `offsetOf(length)` is the total height. */ offsetOf: (index: number) => number; totalHeight: () => number; /** Sum of the first `count` item heights — the prepend anchoring delta. */ prefixHeight: (count: number) => number; /** Half-open `[start, end)` index range covering the viewport plus overscan. */ visibleRange: (scrollTop: number, viewportHeight: number, overscan: number) => { start: number; end: number; }; } /** * Height bookkeeping for a dynamic-height virtual window. Heights live in a * key-indexed map so a prepend — which shifts every index — never invalidates * a measurement; offsets are a lazily rebuilt prefix-sum over the current * key order. */ export declare function createPositionCache(estimatedItemHeight: number): PositionCache;