UNPKG

@selenite/graph-editor

Version:

A graph editor for visual programming, based on rete and svelte.

32 lines (31 loc) 1.25 kB
import type { AreaPlugin } from 'rete-area-plugin'; import type { Schemes } from '../schemes'; import type { AreaExtra } from '../area'; import type { NodeEditor, NodeFactory } from '../editor'; import type { GeosDataContext } from '../../geos'; import type { NewGeosContext } from '../../global/todo.svelte'; export declare abstract class SetupClass { abstract setup(editor: NodeEditor, area: AreaPlugin<Schemes, AreaExtra>, factory: NodeFactory, geos: GeosDataContext, geosContextV2: NewGeosContext): void; } export type Setup = { name: string; } & ({ setup: SetupFunction; type?: 'editor'; } | { setup: SetupAreaFunction; type: 'area'; }); export type SetupParams = { editor: NodeEditor; factory: NodeFactory; container?: HTMLElement; area?: AreaPlugin<Schemes, AreaExtra>; }; export type SetupParamsWithArea = SetupParams & { area: AreaPlugin<Schemes, AreaExtra>; }; export type SetupResult = {}; export type SetupFunction = (params: SetupParams) => SetupParams | Promise<SetupParams> | void | Promise<void>; export type SetupAreaFunction = (params: SetupParamsWithArea) => SetupParamsWithArea | Promise<SetupParamsWithArea> | void | Promise<void>; export declare function isSetup(o: unknown): o is Setup;