UNPKG

1.16 kBTypeScriptView Raw
1import * as React from 'react';
2interface DraggableItemPosition {
3 /** Parent droppableId */
4 droppableId: string;
5 /** Index of item in parent Droppable */
6 index: number;
7}
8export declare const DragDropContext: React.Context<{
9 onDrag: (_source: DraggableItemPosition) => boolean;
10 onDragMove: (_source: DraggableItemPosition, _dest?: DraggableItemPosition) => void;
11 onDrop: (_source: DraggableItemPosition, _dest?: DraggableItemPosition) => boolean;
12}>;
13interface DragDropProps {
14 /** Potentially Droppable and Draggable children */
15 children?: React.ReactNode;
16 /** Callback for drag event. Return true to allow drag, false to disallow. */
17 onDrag?: (source: DraggableItemPosition) => boolean;
18 /** Callback on mouse move while dragging. */
19 onDragMove?: (source: DraggableItemPosition, dest?: DraggableItemPosition) => void;
20 /** Callback for drop event. Return true to allow drop, false to disallow. */
21 onDrop?: (source: DraggableItemPosition, dest?: DraggableItemPosition) => boolean;
22}
23export declare const DragDrop: React.FunctionComponent<DragDropProps>;
24export {};
25//# sourceMappingURL=DragDrop.d.ts.map
\No newline at end of file