UNPKG

@barchart/common-js

Version:
49 lines (48 loc) 1.02 kB
/** * @typedef {import('./Vertex.js').default} Vertex */ /** * One edge of a directed graph, describing the connection between * two vertices; where the edge has a direction. * * @public */ export default class Edge { /** * @param {Vertex} from * @param {Vertex} to * @param {*=} data */ constructor(from: Vertex, to: Vertex, data?: any | undefined); /** * The starting vertex. * * @public * @returns {Vertex} */ public get from(): Vertex; /** * The end vertex. * * @public * @returns {Vertex} */ public get to(): Vertex; /** * Ad hoc data associated with the edge (in other words the "value" * of the edge). * * @public * @returns {*|null} */ public get data(): any | null; /** * Returns a string representation. * * @public * @returns {string} */ public toString(): string; #private; } export type Vertex = import("./Vertex.js").default;