import { Alignment, CellSizeGetter, VisibleCellRange } from '../types'; import CellSizeAndPositionManager, { SizeAndPositionData } from './CellSizeAndPositionManager'; interface ContainerSizeAndOffset { containerSize: number; offset: number; } /** * Browsers have scroll offset limitations (eg Chrome stops scrolling at ~33.5M pixels where as Edge tops out at ~1.5M pixels). * After a certain position, the browser won't allow the user to scroll further (even via JavaScript scroll offset adjustments). * This util picks a lower ceiling for max size and artificially adjusts positions within to make it transparent for users. */ interface Params { maxScrollSize?: number; cellCount: number; cellSizeGetter: CellSizeGetter; estimatedCellSize: number; } /** * Extends CellSizeAndPositionManager and adds scaling behavior for lists that are too large to fit within a browser's native limits. */ export default class ScalingCellSizeAndPositionManager { _cellSizeAndPositionManager: CellSizeAndPositionManager; _maxScrollSize: number; constructor({ maxScrollSize, ...params }: Params); areOffsetsAdjusted(): boolean; configure(params: { cellCount: number; estimatedCellSize: number; cellSizeGetter: CellSizeGetter; }): void; getCellCount(): number; getEstimatedCellSize(): number; getLastMeasuredIndex(): number; /** * Number of pixels a cell at the given position (offset) should be shifted in order to fit within the scaled container. * The offset passed to this function is scaled (safe) as well. */ getOffsetAdjustment({ containerSize, offset }: ContainerSizeAndOffset): number; getSizeAndPositionOfCell(index: number): SizeAndPositionData; getSizeAndPositionOfLastMeasuredCell(): SizeAndPositionData; /** See CellSizeAndPositionManager#getTotalSize */ getTotalSize(): number; /** See CellSizeAndPositionManager#getUpdatedOffsetForIndex */ getUpdatedOffsetForIndex({ align, containerSize, currentOffset, // safe targetIndex }: { align: Alignment; containerSize: number; currentOffset: number; targetIndex: number; }): number; /** See CellSizeAndPositionManager#getVisibleCellRange */ getVisibleCellRange({ containerSize, offset }: ContainerSizeAndOffset): VisibleCellRange; resetCell(index: number): void; _getOffsetPercentage({ containerSize, offset, // safe totalSize }: { containerSize: number; offset: number; totalSize: number; }): number; _offsetToSafeOffset({ containerSize, offset }: ContainerSizeAndOffset): number; _safeOffsetToOffset({ containerSize, offset }: ContainerSizeAndOffset): number; } export {}; //# sourceMappingURL=ScalingCellSizeAndPositionManager.d.ts.map