import { IGraph } from '../Graphs/Graph.js'; import { NodeConfiguration } from './Node.js'; import { IFunctionNodeDefinition, IHasTriggered, SocketNames, SocketsDefinition } from './NodeDefinitions.js'; import { NodeConfigurationDescription } from './Registry/NodeDescription.js'; export type SocketValues = { [key in SocketNames]?: any; }; /** Helper function to test an function node's exec and get the resulting outputs. * Can simulate the input socket values. Returns the output socket values */ export declare const testExec: ({ nodeInputVals, configuration, exec, makeGraph }: { /** Exec function from the node defintion */ exec: (params: import("./NodeDefinitions.js").FunctionNodeExecParams) => void | Promise; /** Runtime configuration of the node */ configuration?: NodeConfiguration | undefined; /** Simulated input values the input sockets have */ nodeInputVals?: SocketValues | undefined; makeGraph?: (() => IGraph) | undefined; }) => SocketValues; export declare enum RecordedOutputType { write = "write", commit = "commit" } export type RecordedWritesOrCommits = ({ outputType: RecordedOutputType.write; socketName: SocketNames; value: any; } | { outputType: RecordedOutputType.commit; socketName: SocketNames; })[]; /** * Generates a function that can be used to test the triggered function of a node. * The trigger function will maintain state between each invokation, and returns a list * the recorded outputs, including the commits to flow outputs. * @returns */ export declare const generateTriggerTester: ({ triggered, initialState, out }: { /** Triggered function from the node defintion */ /** Runtime configuration of the node */ configuration?: NodeConfiguration | undefined; makeGraph?: (() => IGraph) | undefined; } & Pick, "triggered" | "initialState"> & { out: TOutput; }, configuration?: NodeConfiguration, makeGraph?: () => IGraph) => ({ inputVals, triggeringSocketName }: { /** input values to simulate on the input sockets */ inputVals?: SocketValues | undefined; /** name of the flow socket that is to be triggered */ triggeringSocketName: SocketNames; }) => RecordedWritesOrCommits;