import { PointerEvent, RefObject } from 'react'; interface DragHandleProps { onPointerDown: (event: PointerEvent) => void; onPointerMove: (event: PointerEvent) => void; onPointerUp: (event: PointerEvent) => void; onPointerCancel: (event: PointerEvent) => void; } interface DragToDismiss { /** Spread on the drag zone — the 48px handle row. */ dragHandleProps: DragHandleProps; /** How far the sheet is currently dragged down, in px. `0` when at rest. */ dragOffset: number; /** `dragOffset` as a share of the sheet's height, for the scrim to fade with the drag. */ dragRatio: number; /** While the sheet is dragged up and can expand: its height under the finger, in px. */ liftedHeight: number | null; } /** * Drag the sheet down past 30% of its height, or fling it down, to dismiss it; release earlier and it * settles back. Dragged up, a sheet that could expand when the gesture started follows the finger * (`liftedHeight`); released after 48px or flung up, `onDragUp` expands it, otherwise it settles back. * The way back is a drag too: an expanded sheet (`onCollapse`) dragged down 48px or flung down returns * to half height, and only a drag that leaves less than 70% of that half on screen dismisses it. * * The drag starts on the handle row (any pointer) or, on touch, anywhere in the `body` while * the body is scrolled to its top and the finger moves down, or while the sheet can still expand and the * finger moves up — as Material's bottom sheet does. Otherwise the body just scrolls. * * Deliberately never the only exit or the only way to resize (WCAG 2.5.7): the close button, the scrim * and Escape close it, and the drag handle toggles the height as a button. A press that starts on any * other button in the drag zone is left alone, so the close control keeps working as a plain click. * The pointer is captured only once it has moved, so a tap on the drag handle stays a click. */ export declare const useDragToDismiss: (sheetRef: RefObject, onDismiss: () => void, onDragUp?: () => void, onCollapse?: () => void, body?: HTMLElement | null) => DragToDismiss; export {};