import Graph, { GraphOption } from '.'; declare type JSONNode = { id: NodeIDType; value?: NodeType; parent?: NodeIDType; }; declare type JSONEdge> = { /** * @description The source node id. * @description.zh-CN 源节点 id。 */ v: NodeIDType; /** * @description The target node id. * @description.zh-CN 目标节点 id。 */ w: NodeIDType; /** * @description The edge value. * @description.zh-CN 边的值。 */ value?: EdgeType; /** * @description The edge name. * @description.zh-CN 边的名称。 */ name?: string; }; declare type JSONGraph = { options: GraphOption; nodes: JSONNode[]; edges: JSONEdge[]; value?: GraphType; }; /** * @description Convert a graph to JSON. * @description.zh-CN 转换图为 JSON。 * @param graph * @returns */ export declare const write: , EdgeType = Record, GraphType = string>(graph: Graph) => JSONGraph; /** * @description read a graph from JSON. * @description.zh-CN 从 JSON 读取图。 * @param json * @returns */ export declare const read: , EdgeType = Record, GraphType = string>(json: JSONGraph) => Graph; export {};