Archived
Template
1
Fork 0
This repository has been archived on 2024-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
Contour/public/@shoelace-style/shoelace/cdn/internal/drag.d.ts
2024-01-30 10:59:28 -05:00

15 lines
699 B
TypeScript

interface DragOptions {
/** Callback that runs as dragging occurs. */
onMove: (x: number, y: number) => void;
/** Callback that runs when dragging stops. */
onStop: () => void;
/**
* When an initial event is passed, the first drag will be triggered immediately using the coordinates therein. This
* is useful when the drag is initiated by a mousedown/touchstart event but you want the initial "click" to activate
* a drag (e.g. positioning a handle initially at the click target).
*/
initialEvent: PointerEvent;
}
/** Begins listening for dragging. */
export declare function drag(container: HTMLElement, options?: Partial<DragOptions>): void;
export {};