diff --git a/packages/core/src/defineNode.ts b/packages/core/src/defineNode.ts index 786ee0ff..a1b4c27a 100644 --- a/packages/core/src/defineNode.ts +++ b/packages/core/src/defineNode.ts @@ -20,7 +20,7 @@ export interface INodeDefinition { outputs?: InterfaceFactory; /** This function is called by the engine with the input values. * It should perform the necessary calculation and then return the output values */ - calculate?: CalculateFunction; + calculate?: CalculateFunction, NoInfer>; /** Called as soon as an instance of the node is created but before it is placed into a graph */ onCreate?: (this: Node) => void; /** Called when the node is placed into a graph */ @@ -45,8 +45,8 @@ export function defineNode(definition: INodeDefinition): new () => N public calculate = definition.calculate ? (inputs: I, globalValues: any) => { - return definition.calculate!.call(this, inputs, globalValues); - } + return definition.calculate!.call(this, inputs, globalValues); + } : undefined; public onPlaced() {