import { EventHandlers } from '../../../../../utils/dom'; import { Axis, Mark, SliderValue } from '../types'; import type * as React from 'react'; interface UseSliderPointerInteractionParameters { axis: Axis; disabled: boolean; disableSwap: boolean; handleChange?: (event: Event | React.SyntheticEvent, value: SliderValue, activeThumb: number) => void; marks: Mark[]; marksValues: number[]; max: number; min: number; minDistance: number; onChangeCommitted?: (event: Event | React.SyntheticEvent, value: SliderValue) => void; range: boolean; readOnly: boolean; setActive: (index: number) => void; setDragging: (value: boolean) => void; setOpen: (index: number) => void; setValueState: (value: SliderValue) => void; sliderRef: React.RefObject; step: null | number; valueDerived: SliderValue; values: number[]; } interface UseSliderPointerInteractionResult { createHandleMouseDown: (otherHandlers: EventHandlers) => (event: React.MouseEvent) => void; } /** * Manages mouse and touch pointer interactions for the slider. * * Handles the full drag lifecycle: * 1. **Pointer down** (mousedown/touchstart) — determines the clicked position, * finds the closest thumb, jumps it to the pointer, and starts listening for moves. * 2. **Pointer move** (mousemove/touchmove) — tracks the finger position, updates * the thumb value in real-time, and triggers the dragging visual state after * `INTENTIONAL_DRAG_COUNT_THRESHOLD` moves. * 3. **Pointer up** (mouseup/touchend) — commits the final value and cleans up listeners. * * Touch events are attached directly to the slider DOM element (not via React) * to control `passive` behavior for scroll prevention. * * @returns `createHandleMouseDown` — a factory that produces the `onMouseDown` handler * for the slider root, composable with external event handlers. */ declare const useSliderPointerInteraction: ({ axis, disabled, disableSwap, handleChange, marks, marksValues, max, min, minDistance, onChangeCommitted, range, readOnly, setActive, setDragging, setOpen, setValueState, sliderRef, step, valueDerived, values, }: UseSliderPointerInteractionParameters) => UseSliderPointerInteractionResult; export default useSliderPointerInteraction;