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)
  • Loading branch information
0b5vr committed Apr 4, 2024
1 parent 411457d commit 0260573
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 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,9 @@ 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
// T might already have Key
[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 0260573

Please sign in to comment.