import { _ as GraphFormatConverter, f as Graph } from "../../types-BAEQTwK_.mjs"; //#region src/formats/jgf/index.d.ts interface JGFNode { id: string; label?: string; metadata?: Record; } interface JGFEdge { id?: string; source: string; target: string; label?: string; metadata?: Record; } interface JGFGraph { graph: { id?: string; directed?: boolean; metadata?: Record; nodes: JGFNode[]; edges: JGFEdge[]; }; } /** * Converts a graph to JSON Graph Format (JGF). * * @example * ```ts * import { createGraph } from '@statelyai/graph'; * import { toJGF } from '@statelyai/graph/jgf'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e0', sourceId: 'a', targetId: 'b' }], * }); * * const jgf = toJGF(graph); * // { graph: { directed: true, nodes: [...], edges: [...] } } * ``` */ declare function toJGF(graph: Graph): JGFGraph; /** * Parses a JSON Graph Format (JGF) object into a graph. * * @example * ```ts * import { fromJGF } from '@statelyai/graph/jgf'; * * const graph = fromJGF({ * graph: { * directed: true, * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ source: 'a', target: 'b' }], * }, * }); * ``` */ declare function fromJGF(jgf: JGFGraph): Graph; /** * Bidirectional converter for JSON Graph Format. * * @example * ```ts * import { createGraph } from '@statelyai/graph'; * import { jgfConverter } from '@statelyai/graph/jgf'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e0', sourceId: 'a', targetId: 'b' }], * }); * * const jgf = jgfConverter.to(graph); * const roundTripped = jgfConverter.from(jgf); * ``` */ declare const jgfConverter: GraphFormatConverter; //#endregion export { JGFEdge, JGFGraph, JGFNode, fromJGF, jgfConverter, toJGF };