import type { DimensionSettingsState, PositionItem, ViewSettingSizeProp, ViewportStateItems, VirtualPositionItem, Range } from "../../types/index";
export type DimensionDataViewport = Pick<DimensionSettingsState, 'indexes' | 'positionIndexes' | 'positionIndexToItem' | 'sizes' | 'originItemSize' | 'realSize'>;
export type ItemsToUpdate = Pick<ViewportStateItems, 'items' | 'start' | 'end'>;
export declare function getViewportMaxCoordinate(dimension: Pick<DimensionSettingsState, 'realSize' | 'originItemSize'>, viewportSize: number, frameOffset?: number): number;
/**
 * Clamp the viewport coordinate within the valid range.
 * Given a scroll position, pick a safe starting point for rendering visible items.
 *
 * Do not use it when you need the exact scroll position for positioning math.
 *
 * It does two things:
 * 1. If the coordinate is below 0, use 0.
 * 2. If the coordinate is too close to the very end, pull it back a bit.
 *
 * Example:
 *
 * content height: 1000px
 * viewport height: 200px
 * row height: 30px
 * The real max scroll is:
 *
 * 1000 - 200 = 800
 * But clampViewportCoordinate may clamp to:
 *
 * 1000 - 200 - 30 = 770
 * Ask for 800 -> it returns 770.
 */
export declare function clampViewportCoordinate(coordinate: number, dimension: Pick<DimensionSettingsState, 'realSize' | 'originItemSize'>, viewportSize: number, frameOffset?: number): number;
/**
 * Update items based on new scroll position
 * If viewport wasn't changed fully simple recombination of positions
 * Otherwise rebuild viewport items
 */
export declare function getUpdatedItemsByPosition<T extends ItemsToUpdate>(pos: number, // coordinate
items: T, realCount: number, virtualSize: number, dimension: DimensionDataViewport): ItemsToUpdate;
export declare function updateMissingAndRange(items: VirtualPositionItem[], missing: VirtualPositionItem[], range: Range): void;
/**
 * If partial replacement
 * this function adds items if viewport has some space left
 */
export declare function addMissingItems<T extends ItemsToUpdate>(firstItem: PositionItem, realCount: number, virtualSize: number, existingCollection: T, dimension: Pick<DimensionSettingsState, 'sizes' | 'originItemSize'>): VirtualPositionItem[];
/**
 * Get wiewport items parameters
 * caching position and calculating items count in viewport
 */
export declare function getItems(opt: {
    firstItemIndex: number;
    firstItemStart: number;
    origSize: number;
    maxSize: number;
    maxCount: number;
    sizes?: ViewSettingSizeProp;
}, currentSize?: number): VirtualPositionItem[];
/**
 * Do batch items recombination
 * If items not overlapped with existing viewport returns null
 */
type RecombindDimensionData = Pick<DimensionSettingsState, 'sizes' | 'realSize' | 'originItemSize'>;
type RecombineOffsetData = {
    positiveDirection: boolean;
} & ItemsToUpdate & RecombindDimensionData;
export declare function recombineByOffset(offset: number, data: RecombineOffsetData): ItemsToUpdate | undefined;
/**
 * Verify if position is in range of the PositionItem, start and end are included
 */
export declare function isActiveRange(pos: number, realSize: number, first?: PositionItem, last?: PositionItem): boolean;
export declare function isActiveRangeOutsideLastItem(pos: number, virtualSize: number, firstItem?: PositionItem, lastItem?: PositionItem): boolean;
export declare function getFirstItem(s: ItemsToUpdate): VirtualPositionItem;
export declare function getLastItem(s: ItemsToUpdate): VirtualPositionItem;
/**
 * Set items sizes from start index to end
 * @param vpItems
 * @param start
 * @param size
 * @param lastCoordinate
 * @returns
 */
export declare function setItemSizes(vpItems: VirtualPositionItem[], initialIndex: number, size: number, lastCoordinate: number): VirtualPositionItem[];
export {};
