export declare const DndTransferTypeConst: {
    readonly Field: "dnd:field";
    readonly PaperWidget: "dnd:paper-widget";
};
export type DndTransferType = ValueOf<typeof DndTransferTypeConst>;
export interface DndGenericTypes<TFieldData = unknown, TPaperWidgetData = unknown> {
    _fieldData?: TFieldData;
    _paperWidgetData?: TPaperWidgetData;
}
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 拖拽放置回调 */
    onPaperWidgetDrop?: (paperWidgetMeta: T['_paperWidgetData'] extends unknown ? T['_paperWidgetData'] : never, mousePos: {
        clientX: number;
        clientY: number;
    }, opts?: Record<string, unknown>) => void;
    /**
     * 是否允许在当前位置放置
     * 返回 false 时阻止 dragover 和 drop，可用于区域限制（如页眉页脚模式）
     */
    canDrop?: (e: DragEvent, isOutOfFlow: boolean) => boolean;
};
export type DndTransferData<T extends DndGenericTypes = DndGenericTypes> = {
    type: typeof DndTransferTypeConst.Field;
    data: T['_fieldData'] extends unknown ? T['_fieldData'] : never;
} | {
    type: typeof DndTransferTypeConst.PaperWidget;
    data: T['_paperWidgetData'] extends unknown ? T['_paperWidgetData'] : never;
};
export declare const DndTransferKey: "__gct_dnd_transfer__";
/** 设置传输数据 */
export declare function setDndTransferData(e: DragEvent, data: DndTransferData, outOfFlow: boolean): void;
export declare function useDragdrop(allowTypes: DndTransferType[], callbacks?: Callbacks): {
    handleDrop: (e: DragEvent, opts?: any) => void;
    handleDragOver: (e: DragEvent, opts?: any) => void;
};
