UNPKG

@selenite/graph-editor

Version:

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

40 lines (39 loc) 1.37 kB
import { NodeFactory, NodeEditor } from '../editor'; import type { NodeEditorSaveData } from '../editor'; import { Socket } from '../socket'; import { Node, type SocketsValues } from './Node.svelte'; import type { DataType } from '../plugins/typed-sockets'; import type { StoredGraph } from '../storage/types'; import { type NodeParams } from '..'; export declare class InputNode extends Node<{}, { value: Socket<DataType>; }> { #private; constructor(params?: NodeParams & { isArray?: boolean; }); data(inputs?: SocketsValues<{}> | undefined): SocketsValues<{ value: Socket<DataType, 'scalar' | 'array'>; }>; get value(): unknown; set value(v: unknown); setValue(val: unknown): void; } export declare class MacroNode extends Node { readonly macroEditor?: NodeEditor; readonly macroFactory?: NodeFactory; private inputNodes; private macroInputs; forward?: (output: string) => unknown; graph: StoredGraph | undefined; constructor(params?: NodeParams & { graph?: StoredGraph; }); initialize(params: { graphId: string; saveData: NodeEditorSaveData; }): Promise<void>; execute(input: string, forward: (output: string) => unknown): void; data(inputs?: SocketsValues<R> | undefined): Promise<SocketsValues<{}>>; isOutdated(): Promise<boolean>; }