UNPKG

@chamn/engine

Version:
43 lines (42 loc) 1.3 kB
import { Edge, Node } from '@xyflow/react'; import { SetterType, TActionLogicItem } from '@chamn/model'; /** 自动布局 flow node */ export declare const calculateElementLayout: (nodes: Node[], edges: Edge[], options: { direction: "TB" | "LR"; }) => { nodes: Node[]; edges: Edge[]; }; /** 将 json schema 转换为 react-flow 节点和边信息 */ export declare const parseActionLogicToNodeList: (value: TActionLogicItem) => { nodes: Node[]; edges: Edge[]; }; /** 将节点格式化json schema */ export declare const revertNodeToActionLogic: (params: { nodes: Node[]; edges: Edge[]; }) => TActionLogicItem; /** 通用的 flow action 画布中的 setter 配置 */ export declare const CommonDynamicValueSetter: SetterType[]; export declare const UseNodeHasConnected: (data: any, handleId: string) => boolean; export declare const getNewNodePosInfo: (currentNode: Node, newNodeData: any, sourceHandle?: string) => { newEdge: { id: string; source: string; sourceHandle: string; target: any; targetHandle: string; }; newNode: { id: any; type: any; position: { x: number; y: number; }; /** 必须 */ dragHandle: string; data: any; }; };