import { Edge, Node as BaseNode } from "reactflow"; import { FlowDesignerEvents } from "../constants"; import { WidgetValue } from "../examples/BaseFlow/common/Output"; /** 流程类型 */ export declare enum FlowType { /** 主流程 */ Main = 1, /** 子流程 */ Sub = 2 } export declare namespace MagicFlow { interface Node extends BaseNode { id: string; node_id: string; meta: { position: { x: number; y: number; }; [key: string]: any; }; name?: string; next_nodes: string[]; step: number; params?: { branches?: Array<{ branch_id: string; next_nodes: string[]; config?: Record; input?: WidgetValue['value']; output?: WidgetValue['value']; }>; [key: string]: any; }; content?: { [key: string]: any; }; debug?: boolean; index?: number; output?: WidgetValue['value'] | null; input?: WidgetValue['value'] | null; children?: MagicFlow.Node[]; node_version: string; [key: string]: any; } interface Flow { id?: string; name: string; description: string; enabled: boolean; edges: Edge[]; nodes: Node[]; modified_at?: string; type: FlowType; icon?: string; [key: string]: any; } interface ParamsName { params: string; nodeType: string; nextNodes: string; } interface FlowEventListener { type: FlowDesignerEvents; data: any; } }