import type { PositionStrategy } from './strategy'; /** * Position lookups for a uniform base size plus per-index overrides ("exceptions" — e.g. the * DOM-measured oversized rows on top of the default row height). Stores only the exceptions: * their sorted indexes and the prefix sums of their size deltas against the base. Building costs * O(exceptions log exceptions) — independent of the total item count — and every offset is * `index × base + binary-searched delta sum`. At 1M uniform rows with a few thousand oversized * rows this replaces a 1M-iteration prefix-sum build and an 8 MB allocation per rebuild. */ export declare class SparsePositionStrategy implements PositionStrategy { #private; /** * Sparse mode never holds a full prefix-sum array. * * @type {null} */ readonly prefixSum: null; /** * @param {Record} exceptions Per-index size overrides. * @param {number} totalItems The total item count read at build time. * @param {Function} sizeFn A function that returns the size for a given index. * @param {number} defaultSize The default item size read at build time. */ constructor(exceptions: Record, totalItems: number, sizeFn: (index: number) => number, defaultSize: number); /** * Returns the cumulative size before the given item index. * * @param {number} index The item index. * @returns {number} The cumulative size before this index. */ getOffset(index: number): number; /** * Finds the item index at a given pixel offset by binary-searching the index space over * `getOffset` (O(log n log k)). Same return semantics as the prefix-sum strategy. * * @param {number} offset The pixel offset. * @returns {number} The index whose cumulative start position is at or just before the offset. */ findIndexAtOffset(offset: number): number; /** * Returns the size of the single item at the given index. * * @param {number} index The item index. * @returns {number} The exception size, the base size, or `0` outside the item range. */ getSizeAt(index: number): number; /** * Returns the total size of all items. * * @returns {number} */ getTotalSize(): number; }