import { connector } from './edge/connector';
import { Color } from '../../color';
import { xy } from '@synnaxlabs/x';

import type * as rf from "reactflow";
/** The current viewport state of the diagram */
export interface Viewport {
    position: xy.XY;
    /**
     * A decimal of the current diagram zoom. Larger values represent magnification.
     */
    zoom: number;
}
/** Pluto specific info passed to the 'data' attribute on rf.Edge */
export interface RFEdgeData {
    /** The color of the edge. */
    color: Color.Crude;
    /** A list of segments representing the structure of the edge connector. */
    segments: connector.Segment[];
}
/** The properties for an edge within a diagram. */
export interface Edge extends RFEdgeData {
    /** A unique key for identifying the edge within the diagram. */
    key: string;
    /** The key of the source node for the edge. */
    source: string;
    /** The key of the target node for the edge. */
    target: string;
    /** Whether the edge is currently selected. */
    selected: boolean;
    /**
     * The id of handle on the source node that the edge is connected to. Note that this
     * id is unique only within the source node.
     */
    sourceHandle?: string | null;
    /**
     * The id of the handle on the target node that the edge is connected to. Note that this id
     * is unique only within the target node.
     */
    targetHandle?: string | null;
}
/** The properties for a node within a diagram. */
export interface Node {
    /** A unique key for identifying the node within the diagram. */
    key: string;
    /** The XY coordinate of the top left corner of the node. Unscaled by the viewport. */
    position: xy.XY;
    /** Whether the node is currently selected. */
    selected?: boolean;
    /** An optional z-index for the node. */
    zIndex?: number;
}
/**
 * Translates nodes from their pluto representation to their react-flow representation.
 */
export declare const translateNodesForward: (nodes: Node[]) => rf.Node[];
/** Translates edges from their pluto representation to their react-flow representation. */
export declare const translateEdgesForward: (edges: Edge[]) => Array<rf.Edge<RFEdgeData>>;
/** Translates nodes from their react-flow representation to their pluto representation. */
export declare const translateNodesBackward: (nodes: rf.Node[]) => Node[];
/** Translates edges from their react-flow representation to their pluto representation */
export declare const translateEdgesBackward: (edges: Array<rf.Edge<RFEdgeData>>, defaultColor: Color.Crude) => Edge[];
/** Translates the diagram viewport from its pluto representation to its react-flow representation */
export declare const translateViewportForward: (viewport: Viewport) => rf.Viewport;
/** Translates the diagram viewport from its react-flow representation to its pluto representation */
export declare const translateViewportBackward: (viewport: rf.Viewport) => Viewport;
/**
 * Executes the provided callback against the react-flow representation of the given
 * nodes, then converts
 */
export declare const nodeConverter: (nodes: Node[], f: (nodes: rf.Node[]) => rf.Node[]) => Node[];
export declare const edgeConverter: (edges: Edge[], f: (edges: rf.Edge[]) => rf.Edge[], color: Color.Crude) => Edge[];
//# sourceMappingURL=types.d.ts.map