@selenite/graph-editor
Version:
A graph editor for visual programming, based on rete and svelte.
29 lines (28 loc) • 1.26 kB
TypeScript
import { NodeEditor, NodeFactory, type NodeEditorSaveData } from '../editor';
import type { Writable } from 'svelte/store';
import { type Setup, type SetupFunction } from './Setup';
import { type NodeMenuItem } from '../plugins/context-menu-plugin.svelte';
import { type ShowContextMenu, type XmlSchema } from '@selenite/commons';
export type XmlContext = {};
export type ModalStore = {};
export type SetupGraphEditorParams = {
container?: HTMLElement;
saveData?: NodeEditorSaveData;
xmlContext?: Writable<XmlContext>;
modalStore?: ModalStore;
setups?: (SetupFunction | Setup)[];
xmlSchemas?: Record<string, XmlSchema | undefined>;
};
export type SetupGraphEditorResult = {
editor: NodeEditor;
factory: NodeFactory;
};
export declare function setupGraphEditor(params?: SetupGraphEditorParams): Promise<SetupGraphEditorResult>;
export declare function setupFullGraphEditor(params?: SetupGraphEditorParams & {
showContextMenu?: ShowContextMenu;
additionalNodeItems?: NodeMenuItem[];
}): Promise<SetupGraphEditorResult>;
export declare function setupSvelteGraphEditor(params?: SetupGraphEditorParams & {
showContextMenu?: ShowContextMenu;
additionalNodeItems?: NodeMenuItem[];
}): Promise<SetupGraphEditorResult>;