Skip to content

Commit

Permalink
fix: Fix the ShaderNodeObject circular reference issue
Browse files Browse the repository at this point in the history
The error is since `ContextNode` already has a member `.context` and `ShaderNodeObject` also gives it a method `.context`

See: #744 (comment)

I believe the behavior that the node class properties takes precedance than NodeElements is same as the actual implementation

See: https://github.com/mrdoob/three.js/blob/r163/examples/jsm/nodes/shadernode/ShaderNode.js
  • Loading branch information
0b5vr committed Apr 4, 2024
1 parent 411457d commit d05ef40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/three/examples/jsm/nodes/shadernode/ShaderNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export type Swizzable<T extends Node = Node> =
export type ShaderNodeObject<T extends Node> =
& T
& {
[Key in keyof NodeElements]: NodeElements[Key] extends (node: T, ...args: infer Args) => infer R
? (...args: Args) => R
[Key in keyof NodeElements]: T extends { [K in Key]: infer M } ? M
: NodeElements[Key] extends (node: T, ...args: infer Args) => infer R ? (...args: Args) => R
: never;
}
& Swizzable<T>;
Expand Down

0 comments on commit d05ef40

Please sign in to comment.