export declare const DndTransferTypeConst: {
    readonly Field: "dnd:field";
    readonly Widget: "dnd:widget";
};
export type DndTransferType = ValueOf<typeof DndTransferTypeConst>;
export interface DndGenericTypes<TFieldData = unknown, TWidgetData = unknown> {
    _fieldData?: TFieldData;
    _widgetData?: TWidgetData;
}
export type Callbacks<T extends DndGenericTypes = DndGenericTypes> = {
    /** Field 拖拽放置回调 */
    onFieldDrop?: (fieldMeta: T['_fieldData'] extends unknown ? T['_fieldData'] : never, mousePos: {
        clientX: number;
        clientY: number;
    }, opts?: Record<string, unknown>) => void;
    /** Widget 拖拽放置回调 */
    onWidgetDrop?: (widgetMeta: T['_widgetData'] extends unknown ? T['_widgetData'] : never, mousePos: {
        clientX: number;
        clientY: number;
    }, opts?: Record<string, unknown>) => void;
};
export type DndTransferData<T extends DndGenericTypes = DndGenericTypes> = {
    type: typeof DndTransferTypeConst.Field;
    data: T['_fieldData'] extends unknown ? T['_fieldData'] : never;
} | {
    type: typeof DndTransferTypeConst.Widget;
    data: T['_widgetData'] extends unknown ? T['_widgetData'] : never;
};
export declare const DndTransferKey: "__gct_dnd_transfer__";
/** 设置传输数据 */
export declare function setDndTransferData(e: DragEvent, data: DndTransferData): void;
export declare function useDragdrop(allowTypes: DndTransferType[], callbacks?: Callbacks): {
    handleDrop: (e: DragEvent, opts?: any) => void;
    handleDragOver: (e: DragEvent, opts?: any) => void;
};
