UNPKG

beautiful-react-hooks

Version:

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

20 lines (19 loc) 1.05 kB
import { RefObject } from 'react'; /** * Returns an object of callback setters to handle the drag-related events. * It accepts a DOM ref representing the events target (where attach the events to). * * Returned callback setters: `onDrag`, `onDrop`, `onDragEnter`, `onDragEnd`, `onDragExit`, `onDragLeave`, * `onDragOver`, `onDragStart`; */ declare const useDragEvents: <TElement extends HTMLElement>(targetRef: RefObject<TElement>, isDraggable?: boolean) => Readonly<{ onDrag: import("./shared/types").CallbackSetter<DragEvent>; onDrop: import("./shared/types").CallbackSetter<DragEvent>; onDragEnter: import("./shared/types").CallbackSetter<DragEvent>; onDragEnd: import("./shared/types").CallbackSetter<DragEvent>; onDragExit: import("./shared/types").CallbackSetter<DragEvent>; onDragLeave: import("./shared/types").CallbackSetter<DragEvent>; onDragOver: import("./shared/types").CallbackSetter<DragEvent>; onDragStart: import("./shared/types").CallbackSetter<DragEvent>; }>; export default useDragEvents;