import { Node, Edge } from '../FlowPanel';
import { FlowNode, ParseFlowLog, FlowNodeLog, FlowNodeSingleLog } from '../type';
import { EndManager, NodeManager, StartManager, FlowData } from './type';

interface ChangeFlowListener {
    (): void;
}
export default class FlowManager<T extends Record<string, any> = any> {
    static NodeManagers: Record<string, NodeManager>;
    static StartManagers: Record<string, StartManager>;
    static EndManagers: Record<string, EndManager>;
    static StartNodeId: string;
    static EndNodeId: string;
    flow: FlowData<T>;
    private logInfo?;
    private nodeLogWithParams;
    private nodeWithLog;
    private onChangeListeners;
    constructor(flow: FlowData<T>, logInfo?: Pick<ParseFlowLog, 'input' | 'log' | 'output'>);
    static UseNode(nodeManager: NodeManager): void;
    static GetNodeManagerByType(type: string): NodeManager<any>;
    static UseStart(startManager: StartManager): void;
    static GetStartManagerByType(type: string): StartManager<any>;
    static UseEnd(endManager: EndManager): void;
    static GetEndManagerByType(type: string): EndManager | undefined;
    insertNode(handleNodeId: string, type: FlowNode['type'], data: any): void;
    removeNode(nodeId: string): void;
    updateNode(nodeId: string, nodeInfo: Pick<FlowNode, 'label' | 'params' | 'result'>): void;
    getNodeById(nodeId: string): FlowNode<any>;
    getUiNodeAndEdge(): {
        nodes: Omit<Node<any>, "position">[];
        edges: Edge<any>[];
    };
    createSingleNodeUi(nodeId: string, options: Parameters<NodeManager['onCreateUi']>[2]): {
        endNodeId: string;
        payload?: any;
    };
    triggerChangeListener(): void;
    addChangeListener(fn: ChangeFlowListener): () => void;
    resetLogInfo(logInfo?: Pick<ParseFlowLog, 'input' | 'log' | 'output'>): void;
    computedLog(): void;
    computedSingleNodeLog(nodeLog: FlowNodeLog): void;
    getLogByNodeName(nodeName: 'input' | 'output'): Record<string, any> | undefined;
    getLogByNodeName(nodeName: string): FlowNodeSingleLog[] | undefined;
    setLogNodeWithLog(nodeName: string, logs?: FlowNodeSingleLog[]): void;
    getNodeLogs(): FlowNodeLog[];
    getLogParamsByNodeName<T>(nodeName: string): T | undefined;
    setLogParams(nodeName: string, params: any): void;
}
export {};
