react-dnd-preview
Version:
Preview component for React DnD
9 lines (8 loc) • 459 B
TypeScript
import type { RefObject } from 'react';
import type { DragLayerMonitor } from 'react-dnd';
export type Point = {
x: number;
y: number;
};
export type PreviewPlacement = 'center' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';
export declare const calculatePointerPosition: (monitor: DragLayerMonitor, childRef: RefObject<Element | null>, placement?: PreviewPlacement, padding?: Point) => Point | null;