import { IEdge, IEdgeInstance } from './edge'; import { IMinimapOptions, IEdgeConfig, INodeConfig, IGraphConfig } from './editor'; import { IEndpointsInstance, INode, INodeInstance, INodeSource } from './node'; export interface IGraph { id: string; existedSelectedGroupNum: number; nodeConfig?: INodeConfig; edgeConfig?: IEdgeConfig; fromJSON: (props?: { nodes: INode[]; edges: IEdge[]; autoFocusCenter?: boolean; autoFixCenter?: boolean; }, callback?: Function) => void; appendNode: (node: { id?: string; } & INode) => string; appendNodes: (nodes: ({ id?: string; } & INode)[]) => void; appendEdge: (edge: IEdge) => void; appendEdges: (edges: IEdge[]) => void; toJSON: () => { edges: IEdge[]; nodes: INode[]; }; beforeFormDestory?: () => Promise; nodes: INodeInstance[]; edges: IEdgeInstance[]; getEndpoints: (nodeIds?: string[]) => IEndpointsInstance[]; hideEndpoints: (nodeIds?: string[]) => void; unHideEndpoints: (nodeIds?: string[]) => void; isDraggingEndpoint: () => boolean; getIsolatedNodes: (type?: 'no-output' | 'no-source' | 'no-source-output') => INodeInstance[]; editable: boolean; getNodeById: (id: string) => INodeInstance | undefined; getNode: (id: string) => INodeInstance | undefined; getEdgeById: (id: string) => IEdgeInstance | undefined; getNodes: (ids?: string[]) => INodeInstance[]; getEdges: (ids?: string[]) => IEdgeInstance[]; getCells: (id?: string[]) => { nodes: INodeInstance[]; edges: IEdgeInstance[]; }; getCellById: (id: string) => INodeInstance | IEdgeInstance | undefined; findNodes: (params?: { [key: keyof INode]: any; }) => INodeInstance[]; findEdges: (params?: { [key: keyof IEdge]: any; }) => IEdgeInstance[]; findCells: (params?: { [key: keyof (IEdge & IEdge)]: any; }) => { nodes: INodeInstance[]; edges: IEdgeInstance[]; }; updateNodeById: (id: string, params: { [key: keyof INode]: any; }) => void; updateEdgeById: (id: string, params: { [key: keyof IEdge]: any; }) => void; select: (selectedItem: INodeInstance | IEdgeInstance | { nodes?: INodeInstance[]; edges?: IEdgeInstance[]; }) => Promise; clearSelect: (props?: { needConfirm?: boolean; }) => void; selectedItem?: INodeInstance | IEdgeInstance | null; selectedEdges: IEdgeInstance[]; selectedNodes: INodeInstance[]; redo: () => void; undo: () => void; _rootWidth: number; _rootHeight: number; root: HTMLElement; getNodeSources?: () => INodeSource[]; formVisible: boolean; toggleFormVisible: (node?: any) => void; bottomPanelVisible?: boolean; toggleBottomPanelVisible: () => void; duplicate: () => void; deleteNodes: (ids: string[]) => void; deleteEdges: (ids: string[]) => void; removeSelected?: () => void; terminal2canvas: (params: [number, number]) => [number, number]; focusNodesWithAnimate: (params: { nodes: string[]; }) => void; setMinimap: (isOpen: boolean, params?: IMinimapOptions) => void; on: (key: 'system.node.click' | 'system.node.move' | 'system.link.connect' | 'system.drag.start' | string, fn: Function) => void; getZoom: () => number; emit: (key: string, data: any) => void; actionQueue: Array; actionQueueIndex: number; isActionQueueTop: () => boolean; isActionQueueBottom: () => boolean; graphConfig?: IGraphConfig; getNodePropertyKey: () => string; getEdgePropertyKey: () => string; }