import { type MomentumConfig } from "./momentum"; import type { OrientationProps } from "./transform-manager"; import { type ParsedTransition, WaapiAnimationCore } from "./waapi-core"; export declare class InfiniteScrollManager extends WaapiAnimationCore { private orientationProps; private cachedViewportSize; private cachedTotalContentSize; private cachedItemPositions; private cachedItemSizes; private cachedGap; private itemCount; private layoutInvalidated; private itemTransforms; constructor(params: { scrollArea: HTMLElement; orientationProps: OrientationProps; parsedTransition: { value: ParsedTransition | null; }; }); invalidateLayout(): void; updateLayout(itemRefs: Array<{ value: HTMLElement | undefined; }>): void; getTotalContentSize(): number; getViewportSize(): number; getItemTransforms(): number[]; private getDistanceFromViewport; updateOffsets(itemRefs: Array<{ value: HTMLElement | undefined; }>, currentTransform: number): void; clearItemOffsets(itemRefs: Array<{ value: HTMLElement | undefined; }>): void; getInfiniteBoundaries(): { min: number; max: number; }; private getTargetVisualPos; private findClosestIndex; getSnapDeltaForItem(currentTransform: number, align: "start" | "center" | "end", targetIndex: number): number; findClosestItemForSnap(currentTransform: number, align: "start" | "center" | "end"): { index: number; snapDelta: number; }; getItemStepSize(index: number): number; /** * Calculates the shortest distance transform to a target index in the infinite loop. * Uses robust modulo arithmetic to find the global closest limit, ignoring potentially stale item offsets. */ getShortestDistanceTransform(currentTransform: number, targetIndex: number, align: "start" | "center" | "end"): number; /** * Shared animation execution logic to strictly enforce DRY. * Handles WAAPI setup, frame tracking, and cleanup. */ /** * Animates to a specific item index for programmatic navigation in loop mode. * Uses WAAPI to allow frame-by-frame offset updates for seamless wrapping. */ animateToItem(params: { targetIndex: number; currentTransform: number; align: "start" | "center" | "end"; itemRefs: Array<{ value: HTMLElement | undefined; }>; onFrame: (transform: number) => void; onComplete: () => void; }): { snapDelta: number; animation: Animation | null; }; /** * Finds the item index closest to a canonical scroll position (0..totalSize). * Ignores current item offsets/wrapping, purely based on static layout. */ private findClosestCanonicalIndex; findMomentumSnapTarget(currentTransform: number, align: "start" | "center" | "end", velocity: number, momentumConfig?: Partial): { index: number; snapDelta: number; }; animateSnap(params: { currentTransform: number; align: "start" | "center" | "end"; velocity?: number; momentumConfig?: Partial; itemRefs: Array<{ value: HTMLElement | undefined; }>; onFrame: (transform: number) => void; onComplete: () => void; }): { index: number; snapDelta: number; animation: Animation | null; }; } export declare function getCachedInfiniteScrollManager(params: { scrollArea: HTMLElement | undefined; orientationProps: OrientationProps; parsedTransition: { value: ParsedTransition | null; }; }): InfiniteScrollManager | null;