Skip to content

Commit

Permalink
Improve type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat committed Mar 16, 2024
1 parent aed7abf commit c959e6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/defineNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface INodeDefinition<I, O> {
outputs?: InterfaceFactory<O>;
/** 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<I, O>;
calculate?: CalculateFunction<NoInfer<I>, NoInfer<O>>;
/** Called as soon as an instance of the node is created but before it is placed into a graph */
onCreate?: (this: Node<I, O>) => void;
/** Called when the node is placed into a graph */
Expand All @@ -45,8 +45,8 @@ export function defineNode<I, O>(definition: INodeDefinition<I, O>): 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() {
Expand Down

0 comments on commit c959e6f

Please sign in to comment.