import type { MotionProps } from '../../motion/types'; import type { VisualElement } from '../../render/types'; import type { Point2D, TransformPoint2D } from '../../types/geometry'; import type { DraggableProps } from './types'; interface DragControlConfig { visualElement: VisualElement; } export interface DragControlOptions { snapToCursor?: boolean; cursorProgress?: Point2D; } interface DragControlsProps extends DraggableProps { transformPagePoint?: TransformPoint2D; } export type expectsResolvedDragConstraints = ({ dragConstraints, onMeasureDragConstraints }: MotionProps) => boolean; declare var elementDragControls: WeakMap, VisualElementDragControls>; declare class VisualElementDragControls { /** * Track whether we're currently dragging. * * @internal */ isDragging: boolean; /** * The current direction of drag, or `null` if both. * * @internal */ private currentDirection; /** * The permitted boundaries of travel, in pixels. * * @internal */ private constraints; /** * The per-axis resolved elastic values. * * @internal */ private elastic; /** * A reference to the host component's latest props. * * @internal */ private props; /** * @internal */ private visualElement; /** * @internal */ private hasMutatedConstraints; /** * @internal */ private cancelLayout?; /** * Track the initial position of the cursor relative to the dragging element * when dragging starts as a value of 0-1 on each axis. We then use this to calculate * an ideal bounding box for the VisualElement renderer to project into every frame. * * @internal */ private cursorProgress; private originPoint; private openGlobalLock; /** * @internal */ private panSession?; /** * A reference to the measured constraints bounding box */ private constraintsBox?; constructor({ visualElement }: DragControlConfig); /** * Instantiate a PanSession for the drag gesture * * @public */ start: (originEvent: PointerEvent, { snapToCursor, cursorProgress }?: DragControlOptions) => void; resolveDragConstraints: () => void; private resolveRefConstraints; private cancelDrag; private stop; snapToCursor: (point: Point2D) => boolean; /** * Update the specified axis with the latest pointer information. */ private updateAxis; private updateAxisMotionValue; private updateVisualElementAxis; setProps: ({ drag, dragDirectionLock, dragPropagation, dragConstraints, dragElastic, dragMomentum, ...remainingProps }: DragControlsProps & MotionProps) => void; /** * Drag works differently depending on which props are provided. * * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. * - If the component will perform layout animations, we output the gesture to the component's * visual bounding box * - Otherwise, we apply the delta to the x/y motion values. */ private getAxisMotionValue; private isLayoutDrag; private isExternalDrag; private animateDragEnd; stopMotion: () => void; private startAxisValueAnimation; scalePoint: () => void; updateConstraints: (onReady?: () => void) => void; mount: (visualElement: VisualElement) => (() => void); } export { VisualElementDragControls, elementDragControls }; //# sourceMappingURL=VisualElementDragControls.d.ts.map