import type { Designer } from '.';
import type { Node } from '../document';
import type { Simulator } from '../simulator';
import type { NodeSchema } from '../types';
import type { ComponentInstance } from './component-meta';
import type { LocateEvent } from './location';
import type { Sensor } from './sensor';
export declare enum DRAGON_EVENT {
    DRAGSTART = "dragstart",
    DRAG = "drag",
    DRAGEND = "dragend"
}
export declare enum DragObjectType {
    Node = "node",
    NodeData = "nodedata"
}
export declare class DragObject {
    type: DragObjectType;
    data?: NodeSchema | NodeSchema[] | undefined;
    nodes?: (Node | null)[] | undefined;
}
export interface DragAnyObject {
    type: string;
    [key: string]: any;
}
export interface DragNodeObject<T = Node> {
    type: DragObjectType.Node;
    nodes: T[];
}
export interface DragNodeDataObject {
    type: DragObjectType.NodeData;
    data: NodeSchema | NodeSchema[];
    thumbnail?: string;
    description?: string;
    [extra: string]: any;
}
export interface NodeInstance<T = ComponentInstance, N = Node> {
    docId: string;
    nodeId: string;
    instance: T;
    node?: N | null;
}
export declare function isDragAnyObject(obj: any): obj is DragAnyObject;
export declare const isDragNodeObject: (obj: any) => obj is DragNodeObject;
export declare const isDragNodeDataObject: (obj: any) => obj is DragNodeDataObject;
export declare const isLocateEvent: (e: any) => e is LocateEvent;
export declare const isDragEvent: (e: any) => e is DragEvent;
export declare const isInvalidPoint: (e: any, last: any) => boolean;
export declare const isSameAs: (e1: MouseEvent | DragEvent, e2: MouseEvent | DragEvent) => boolean;
/**
 * mouse shake check
 */
export declare const isShaken: (e1: MouseEvent | DragEvent, e2: MouseEvent | DragEvent) => boolean;
export declare const setShaken: (e: any) => void;
export declare const getSourceSensor: (dragObject: DragObject) => Simulator | null;
export declare class Dragon {
    readonly designer: Designer;
    emitter: import("..").EventBus;
    private sensors;
    /** current active sensor */
    private accessor _activeSensor;
    get activeSensor(): Sensor<Node<NodeSchema>> | undefined;
    private accessor _dragging;
    get dragging(): boolean;
    constructor(designer: Designer);
    /**
     * Quick listen a shell(container element) drag behavior
     * @param shell container element
     * @param boost boost got a drag object
     * @param eventType choose a event to trigger the dnd
     */
    from(shell: HTMLElement, boost: (e: MouseEvent | DragEvent) => DragObject | null, eventType?: 'mouse' | 'drag'): () => void;
    /**
     * boost your dragObject for dragging(flying)
     * @param dragObject drag object
     * @param boostEvent drag start event
     */
    boost(dragObject: DragObject, boostEvent: MouseEvent | DragEvent): void;
    /**
     * get master sensors(opened documents)
     */
    private getMasterSensors;
    /**
     * get all simulators
     */
    private getSimulators;
    /**
     * 添加投放感应区
     */
    addSensor(sensor: Sensor): void;
    /**
     * 移除投放感应
     */
    removeSensor(sensor: Sensor): void;
    onDragstart(func: (e: LocateEvent) => void): () => void;
    onDrag(func: (e: LocateEvent) => void): () => void;
    onDragend(func: (e: {
        dragObject: DragObject;
        copy?: boolean;
        esc?: boolean;
    }) => void): () => void;
}
export declare const makeEventsHandler: (boostEvent: MouseEvent | DragEvent, sensors: Simulator[]) => (handle: (sdoc: globalThis.Document) => void) => void;
