import { type RefObject } from 'react'; import { type PanelSizing, type PanelSizingConstraints } from './panel-sizing.js'; /** @internal */ export interface PanelDragActions { onDragStart: () => void; onDrag: (movement: number) => void; onDragEnd: () => void; } /** @internal */ export interface PanelDragOptions { /** Element whose width the panel and its sibling content are clamped into. */ containerRef: RefObject; constraints: PanelSizingConstraints; /** Width the panel is painted with, in px, when a drag starts. */ panelWidthPx: number; /** * `1` while widening the panel means dragging to the right, which is the case * for a panel at the start of its container. `-1` for a panel at the end. */ direction: 1 | -1; /** * Paints the resolved geometry directly, without going through React, so the * panel keeps up with the pointer. */ paint: (sizing: PanelSizing) => void; /** Records the width the drag settled on, in px. */ commit: (widthPx: number) => void; } /** * Drag choreography of a resize separator, shared by every layout that offers * one: a drag latches the width it started from, re-clamps the accumulated * movement against the live container on every move, and only reports the * settled width once the gesture ends (APPDEV-19606). * * Callers own where the geometry is painted and where the settled width goes, * never the gesture bookkeeping. * * @internal */ export declare function usePanelDrag(options: PanelDragOptions): PanelDragActions; //# sourceMappingURL=usePanelDrag.d.ts.map