import { VariableDefine } from '@easy-coder/sdk/variable';
import { FlowData } from '../../manager/type';
import { BaseFlow, BaseFlowStatic } from '../type';
import { FlowNode } from '../../type';

interface FlowExecuteRes {
    code: number;
    msg: string;
    data?: any;
}
export default abstract class Base<T extends Record<string, any> = any> implements BaseFlow {
    static Register: Record<string, BaseFlowStatic>;
    readonly flow: FlowData<T>;
    readonly context: Record<string, any>;
    readonly contextDefine: Record<string, VariableDefine.Desc>;
    readonly extra: Record<string, any>;
    constructor(flow: FlowData<T>);
    static GetFlowInstance(flow: FlowData<any>): BaseFlow;
    static AddFlow(Flow: BaseFlowStatic): void;
    execute(input?: Record<string, any>): Promise<FlowExecuteRes>;
    getNodeByName(nodeName: string): FlowNode | undefined;
    addExtra(key: string, v: any): void;
    getExtra<T>(key: string): T;
    private initContext;
    private getFlowReturn;
}
export {};
