/** * Input parameters for hover index calculation. */ export interface HoverCalculationInput { /** Effective Y translation including scroll compensation */ effectiveTranslateY: number; /** Height of each item in pixels */ itemHeight: number; /** Index of the dragged item at drag start */ draggedIndex: number; /** Total number of items in the list */ totalItems: number; /** Current hovered index (for hysteresis calculation) */ currentHoveredIndex: number; } /** * Result of hover index calculation. */ export interface HoverCalculationResult { /** The proposed new hover index */ proposedIndex: number; /** Whether the hover index should switch (crosses hysteresis threshold) */ shouldSwitch: boolean; /** The position delta from dragged index to proposed index */ positionDelta: number; } /** * Calculates the hover index during drag based on translation and scroll offset. * * Uses a bias offset to make it slightly easier to cross into next/prev positions, * and hysteresis to prevent flickering near boundaries. * * This is a worklet function that runs on the UI thread. * * @param input - The calculation input parameters * @returns The calculation result with proposed index and switch decision */ export declare function calculateHoverIndex(input: HoverCalculationInput): HoverCalculationResult; /** * Input parameters for drop index calculation (used in onEnd). */ export interface DropCalculationInput { /** Final Y translation including scroll compensation */ finalY: number; /** Height of each item in pixels */ itemHeight: number; /** Index of the dragged item at drag start */ draggedIndex: number; /** Total number of items in the list */ totalItems: number; /** The hovered index at the moment of release */ hoveredIndexAtEnd: number; } /** * Result of drop index calculation. */ export interface DropCalculationResult { /** The snapped drop index (clamped to hovered range) */ snapIndex: number; /** Position delta from dragged index to snap index */ positionDelta: number; /** The snapped Y position in pixels */ snappedFinalY: number; /** Raw drop index before clamping (for debugging) */ rawDropIndex: number; } /** * Calculates the drop index when the user releases the drag. * * This uses the same offset bias as hover calculation, but also clamps * the result to the range that was actually hovered during the drag. * This prevents overshoots where the item jumps to an index that was * never visually indicated during the drag. * * This is a worklet function that runs on the UI thread. * * @param input - The calculation input parameters * @returns The calculation result with snap index and position delta */ export declare function calculateDropIndex(input: DropCalculationInput): DropCalculationResult; //# sourceMappingURL=hoverCalculation.d.ts.map