UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

36 lines 1.05 kB
import { INodeDefinition, Node } from '../../programmatic/node.js'; import { ToInput } from '../../programmatic/input.js'; import { ToOutput } from '../../programmatic/output.js'; /** * @example * The expected way to use the switch since it relies on dynamic inputs, is to add new Inputs for the switch node * ```ts * const switchNode = new SwitchNode(); * switchNode.addInput("foo", { * type: AnySchema, * }); * * switchNode.addInput("bar", { * type: AnySchema, * }); * * //Now if the condition matches the name 'foo' it will output the value of the foo input * // If no condition matches, it will output the value of the `default` input * * ``` */ export default class NodeDefinition<T> extends Node { static title: string; static type: string; static description: string; inputs: ToInput<{ default: T; condition: string; }>; output: ToOutput<{ value: T; }>; constructor(props: INodeDefinition); execute(): void | Promise<void>; } //# sourceMappingURL=switch.d.ts.map