import { PointerEvent as ReactPointerEvent } from 'react'; /** * Drag-to-resize a spacer's height. * * A spacer is the one item whose whole point is its size, and the only one that * paints nothing to judge that size by: the number in the sidebar says 24, and * whether 24 is the gap the form wanted is a question about the form, not about * the number. So it gets a grip on its bottom edge, and the answer is the gap * opening under the hand. * * Pointer events for the reasons {@link useDragSort} is built on them: the * editor ships inside a shadow root and the gesture has to survive a finger. */ /** Pixels the height snaps to. Fine enough to place a gap, coarse enough to hit. */ export declare const HEIGHT_STEP = 2; /** A spacer may close entirely — a gap of nothing is a legitimate answer. */ export declare const HEIGHT_MIN = 0; /** * Tallest a spacer may be dragged. Not a limit on the value itself: the sidebar * number takes anything, and a form loaded with more keeps it. It is the point * past which a drag has stopped being a way to judge a gap, since neither end * of it is on screen any more. */ export declare const HEIGHT_MAX = 400; /** * The height a drag lands on, given where it started and how far the pointer * travelled. Pure so the arithmetic can be checked directly. * * One to one with the pointer, unlike the card and the submit button: a spacer * hangs in the flow from its top edge, so only the bottom one moves, and it * moves exactly as far as the height changes. */ export declare function heightFromDrag(startHeight: number, travel: number): number; export interface SpacerResize { /** The spacer being resized, or null when no drag is running. */ resizingId: string | null; /** The height it currently shows, in px. The model still holds the old one. */ previewHeight: number | null; /** * Call from a handle's `onPointerDown` to arm a resize. The height it starts * from is measured off the spacer itself, so a press alone changes nothing — * and a spacer that never had a `height` starts from the one it renders at. */ start: (id: string, e: ReactPointerEvent) => void; } export declare function useSpacerResize(onCommit: (id: string, height: number) => void): SpacerResize;