import type { EdgeState } from "../core/constants.js"; import type { EdgeInterface, NodeInterface } from "./graph.js"; export interface EdgeOptions { /** the unique ID of the edge */ id: string | number; /** the ID of the source node */ sourceId: string | number; /** the ID of the target node */ targetId: string | number; /** whether the edge is directed or not */ directed?: boolean; /** origin data reference */ data?: Record; } /** Basic edge data structure */ export declare class Edge implements EdgeInterface { /** Unique uuid of the edge. */ readonly id: string | number; /** ID of the source node. */ private _sourceId; /** ID of the target node. */ private _targetId; /** Whether the edge is directed or not. */ private _directed; /** Origin data reference of the edge. */ private _data; /** Check the type of the object when picking engine gets it. */ readonly isEdge = true; /** Nodes at either end of this edge. */ private readonly _connectedNodes; /** Edge state. */ state: EdgeState; /** * The constructor * @param options.id - information about the edge */ constructor({ id, sourceId, targetId, data, directed }: EdgeOptions); /** * Return the ID of the edge * @return {String|Number} - the ID of the edge. */ getId(): string | number; /** * Return whether the edge is directed or not. * @return {Boolean} true if the edge is directed. */ isDirected(): boolean; /** * Get the ID of the source node. * @return the ID of the source node. */ getSourceNodeId(): string | number; /** * Get the ID of the target node. * @return the ID of the target node. */ getTargetNodeId(): string | number; /** * Return of the value of the selected property key. * @param key - property key. * @return - the value of the property. */ getPropertyValue(key: string): unknown; /** * Set the origin data as a reference. * @param data - the origin data. */ setData(data: Record): void; /** * Update a data property. * @param key - the key of the property * @param value - the value of the property. */ setDataProperty(key: string, value: unknown): void; /** * Set edge state * @param state - the new interaction state for the edge */ setState(state: EdgeState): void; /** * Get edge state * @returns state - the current interaction state for the edge */ getState(): EdgeState; addNode(node: NodeInterface): void; removeNode(node: NodeInterface): void; getConnectedNodes(): NodeInterface[]; } //# sourceMappingURL=edge.d.ts.map