js-draw
Version:
Draw pictures using a pen, touchscreen, or mouse! JS-draw is a drawing library for JavaScript and TypeScript.
17 lines (16 loc) • 537 B
TypeScript
import { Vec2 } from '@js-draw/math';
interface DragStatistics {
roughlyClick: boolean;
endTimestamp: number;
displacement: Vec2;
}
interface DraggableOptions {
draggableChildElements: HTMLElement[];
onDrag(deltaX: number, deltaY: number, totalDisplacement: Vec2): void;
onDragEnd(dragStatistics: DragStatistics): void;
}
export interface DragControl {
removeListeners(): void;
}
declare const makeDraggable: (dragElement: HTMLElement, options: DraggableOptions) => DragControl;
export default makeDraggable;