import type { WCRectangle } from '@adam-sv/arc'; import type { IBoxSize, ICoords } from '@adam-sv/arc'; export type GraphNodeId = T; export type GraphEdgeId = GraphNodeId; export interface IGraphEdge { id?: NodeIdType; from: NodeIdType; to: NodeIdType; datum?: EdgeType; className?: string; } export interface IProcessedGraphNode extends IGraphNode { parent: IProcessedGraphNode | undefined; children: IProcessedGraphNode[]; childrenIds: NodeIdType[]; } export interface IGraphNodeAccessors { getBounds(node: IGraphNode): WCRectangle; getChildren(node: IGraphNode): NodeIdType[]; } export interface IGraphNode { id: NodeIdType; className?: string; label: string; parentId?: NodeIdType; position?: ICoords; role?: 'input' | 'output'; size?: IBoxSize; datum?: NodeType; } export interface IWebcolaAccessors { getBounds(node: IWebcolaNode): WCRectangle; getChildren(node: IWebcolaNode): number[]; } export interface IWebcolaNode { id: number; label: string; parent: IWebcolaNode | undefined; parentId: number | undefined; leaf: boolean; rectangle: WCRectangle; children: number[]; } export interface IWebcolaEdge { id: string; from: number; to: number; } export interface IWebcolaDefinition { nodes: IWebcolaNode[]; edges: IWebcolaEdge[]; accessors: IWebcolaAccessors; getOriginalEdge: (node: IWebcolaEdge) => IGraphEdge; }