import type { NsGraph } from '../../interface';
import type { IContext, IArgsBase } from '../../command/interface';
import { ICommandHandler } from '../../command/interface';
import type { IHooks } from '../../hooks/interface';
import type { HookHub } from '@antv/xflow-hook';
import type { Cell, Edge, Model } from '@antv/x6';
export declare type ICommand = ICommandHandler<NsDelEdge.IArgs, NsDelEdge.IResult, NsDelEdge.ICmdHooks>;
export declare namespace NsDelEdge {
    /** Command: 用于注册named factory */
    const command: import("../../command/interface").IGraphCommand;
    /** hookName */
    const hookKey = "delEdge";
    interface IDeleteEdgeService {
        (args: IArgs): Promise<boolean>;
    }
    /** hook 参数类型 */
    interface IArgs extends IArgsBase {
        /** EdgeCell */
        x6Edge?: Edge<Edge.Properties>;
        /** Edge元数据 */
        edgeConfig?: NsGraph.IEdgeConfig;
        /** X6 Model Options：https://x6.antv.vision/zh/docs/api/graph/model/#addnode */
        options?: Model.RemoveOptions;
        /** Edge 删除服务 */
        deleteEdgeService?: IDeleteEdgeService;
    }
    /** hook handler 返回类型 */
    interface IResult {
        err: any;
        edgeConfig?: {
            source: string | Edge.TerminalData;
            target: string | Edge.TerminalData;
            sourcePortId: string;
            targetPortId: string;
        };
        targetCell?: Cell;
        sourceCell?: Cell;
        sourcePortId?: string;
        targetPortId?: string;
    }
    /** api service 类型 */
    /** hooks 类型 */
    interface ICmdHooks extends IHooks {
        delEdge: HookHub<IArgs, IResult>;
    }
    enum ErrEnum {
        EDGE_NOT_EXIST = "edge is not exist",
        EDGE_INVALID_CELL = "this is not a valid cell",
        X6_DELETE_FAILED = "x6 throw err when call delete edge",
        SERVICE_REJECT = "service reject to delete"
    }
}
export declare class DelEdgeCommand implements ICommand {
    /** api */
    contextProvider: ICommand['contextProvider'];
    /** cmd context 引用 */
    ctx: IContext<NsDelEdge.IArgs, NsDelEdge.IResult, NsDelEdge.ICmdHooks>;
    init(): void;
    /** 执行Cmd */
    execute: () => Promise<this>;
    private findEdgeById;
    /** undo cmd */
    undo: () => Promise<this>;
    /** redo cmd */
    redo: () => Promise<this>;
    isUndoable(): boolean;
}
