import { _ as GraphFormatConverter, f as Graph } from "../../types-BAEQTwK_.mjs"; //#region src/formats/cytoscape/index.d.ts interface CytoscapeNode { data: { id: string; parent?: string; [key: string]: any; }; position?: { x: number; y: number; }; } interface CytoscapeEdge { data: { id: string; source: string; target: string; [key: string]: any; }; } interface CytoscapeJSON { data?: Record; elements: { nodes: CytoscapeNode[]; edges: CytoscapeEdge[]; }; } /** * Converts a graph to Cytoscape.js JSON format. * * @example * ```ts * import { createGraph } from '@statelyai/graph'; * import { toCytoscapeJSON } from '@statelyai/graph/cytoscape'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e0', sourceId: 'a', targetId: 'b' }], * }); * * const cyto = toCytoscapeJSON(graph); * // { elements: { nodes: [...], edges: [...] } } * ``` */ declare function toCytoscapeJSON(graph: Graph): CytoscapeJSON; /** * Parses a Cytoscape.js JSON object into a graph. * * @example * ```ts * import { fromCytoscapeJSON } from '@statelyai/graph/cytoscape'; * * const graph = fromCytoscapeJSON({ * elements: { * nodes: [{ data: { id: 'a' } }, { data: { id: 'b' } }], * edges: [{ data: { id: 'e0', source: 'a', target: 'b' } }], * }, * }); * ``` */ declare function fromCytoscapeJSON(cyto: CytoscapeJSON): Graph; /** * Bidirectional converter for Cytoscape.js JSON format. * * @example * ```ts * import { createGraph } from '@statelyai/graph'; * import { cytoscapeConverter } from '@statelyai/graph/cytoscape'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e0', sourceId: 'a', targetId: 'b' }], * }); * * const cyto = cytoscapeConverter.to(graph); * const roundTripped = cytoscapeConverter.from(cyto); * ``` */ declare const cytoscapeConverter: GraphFormatConverter; //#endregion export { CytoscapeEdge, CytoscapeJSON, CytoscapeNode, cytoscapeConverter, fromCytoscapeJSON, toCytoscapeJSON };