/**
 * Hook for snapping pixel coordinates to the nearest data point.
 *
 * This uses the Recharts scale hooks to convert between pixel and data coordinates,
 * enabling "magnetic" annotation placement that snaps to actual data points.
 *
 * NOTE: This imports from 'recharts' using hooks that are not yet published.
 * TypeScript/ESLint errors are expected until recharts 3.8 is released.
 *
 * The hook detects this by checking if the inverse scale returns a value that differs
 * significantly from the pixel position when converted back. If the roundtrip produces
 * a very different value, it indicates snapping occurred, and we use that. Otherwise,
 * we keep the original coordinate for smooth freeform positioning.
 */
import { MouseEvent } from 'react';
import { Coordinate } from 'recharts';
import { SnapMode } from './types.js';
export interface SnapResult {
    interactionCoordinate: Coordinate;
    snappedCoordinate: Coordinate | undefined;
    dataPoint: {
        x: unknown;
        y: unknown;
    } | undefined;
}
/**
 * Hook that provides a function to snap pixel coordinates to the nearest data point.
 *
 * When snap-to-data is enabled, this will:
 * 1. Convert pixel coordinates to data values using inverse scale
 * 2. Find the closest data point in the domain (categories)
 * 3. Convert back to pixel coordinates for display
 *
 * @example
 * ```tsx
 * const snapToData = useSnapToData({ enabled: true });
 *
 * const handleMouseMove = (x: number, y: number) => {
 *   const snapped = snapToData(x, y);
 *   setPosition({ x: snapped.x, y: snapped.y });
 * };
 * ```
 */
export declare function useSnap(snapMode: SnapMode): (e: MouseEvent<SVGGraphicsElement>) => SnapResult | undefined;
