import {nodeTypes} from "../Tree";

export type RenderedNodeData = {
    id: string,
    type: keyof typeof nodeTypes,
    data: { treeNodeId: string   }
    position: {
        x: number,
        y: number
    }
}

export type EdgeData = {
    id: RenderedNodeData["id"],
    source: string,
    target: string,
    sourceHandle?: string,
    targetHandle?: string,
    type?: string | 'connecting-line',
}

export type FlowData = {
    renderedNodes: RenderedNodeData[],
    edges: EdgeData[]
}

export type FlowDataWithoutPosition = {
    renderedNodes: Omit<RenderedNodeData, 'position'>[],
    edges: EdgeData[]
}

export interface FlowDataCreator {
    createFlowData() : FlowDataWithoutPosition;
}

export interface Identifiable {
    get id() : string;
}