@selenite/graph-editor
Version:
A graph editor for visual programming, based on rete and svelte.
29 lines (28 loc) • 873 B
TypeScript
import { Connection, Node } from '../../nodes/Node.svelte';
import { XmlSchema, type ParsedXmlNodes, type SaveData } from '@selenite/commons';
import type { NodeFactory } from '../NodeFactory.svelte';
export declare function xmlToGraph(params: {
xml: string;
schema: XmlSchema;
factory?: NodeFactory;
}): {
nodes: Node[];
connections: Connection[];
};
/**
* Recursively converts the parsed xml to editor nodes
*/
export declare function parsedXmlToGraph({ xml, schema, factory }: {
xml: ParsedXmlNodes;
schema: XmlSchema;
factory?: NodeFactory;
}): {
nodes: Node[];
connections: Connection[];
};
export declare function addGraphToEditor({ factory, nodes, connections, t0 }: {
factory: NodeFactory;
nodes: (Node | SaveData<Node>)[];
connections: (Connection | SaveData<Connection>)[];
t0: number;
}): Promise<void>;