import * as React from 'react'; /** Options for {@link usePointerAngle}. */ export interface UsePointerAngleOptions { /** * Snap increment in degrees; angles are rounded before either callback sees them, and a drag that stays within one increment emits nothing. * @default 0 — continuous; every pixel of movement reports a fresh angle. */ step?: number | undefined; /** * Fires with the angle in `[0, 360)` on pointer down and on every subsequent * move that changes it, plus the native event that produced it. */ onAngleChange: (angle: number, event: PointerEvent) => void; /** * Fires once with the final angle when the drag ends (`pointerup` or `pointercancel`), for a consumer avoiding one network call per frame. * @default undefined — no-op if omitted. */ onAngleChangeEnd?: ((angle: number, event: PointerEvent) => void) | undefined; } /** Return value of {@link usePointerAngle}. */ export interface UsePointerAngleResult { /** Spread onto the element that defines the circle; its border box is the measurement source, re-measured on every move so scrolling/resizing mid-drag stays correct. */ onPointerDown: (event: React.PointerEvent) => void; /** `true` between pointer down and pointer up/cancel, suitable for a `data-dragging` hook; it's state, so it re-renders once per drag boundary, never per move. */ dragging: boolean; } /** * Turns a pointer position inside an element into a normalized angle in `[0, 360)` — 0° at 12 o'clock, increasing clockwise — for any widget whose input is a direction rather than a distance; takes pointer capture and tracks the drag through document-level listeners so it survives leaving the element or window. * * @example * ```tsx * const [hue, setHue] = React.useState(0); * const { onPointerDown, dragging } = usePointerAngle({ * step: 1, * onAngleChange: setHue, * onAngleChangeEnd: (angle) => save(angle), * }); * *
* ``` */ export declare function usePointerAngle(options: UsePointerAngleOptions): UsePointerAngleResult;