diff --git a/types/three/src/Three.TSL.d.ts b/types/three/src/Three.TSL.d.ts index 5073b6f59..1205918a2 100644 --- a/types/three/src/Three.TSL.d.ts +++ b/types/three/src/Three.TSL.d.ts @@ -129,6 +129,7 @@ export const cubeTexture: typeof TSL.cubeTexture; export const dFdx: typeof TSL.dFdx; export const dFdy: typeof TSL.dFdy; export const dashSize: typeof TSL.dashSize; +export const debug: typeof TSL.debug; export const defaultBuildStages: typeof TSL.defaultBuildStages; export const defaultShaderStages: typeof TSL.defaultShaderStages; export const defined: typeof TSL.defined; diff --git a/types/three/src/nodes/Nodes.d.ts b/types/three/src/nodes/Nodes.d.ts index 7868d6292..9c3dbe065 100644 --- a/types/three/src/nodes/Nodes.d.ts +++ b/types/three/src/nodes/Nodes.d.ts @@ -51,6 +51,7 @@ export { NodeUtils }; // utils export { default as ArrayElementNode } from "./utils/ArrayElementNode.js"; export { default as ConvertNode } from "./utils/ConvertNode.js"; +export { default as DebugNode } from "./utils/DebugNode.js"; export { default as EquirectUVNode } from "./utils/EquirectUVNode.js"; export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js"; export { default as JoinNode } from "./utils/JoinNode.js"; diff --git a/types/three/src/nodes/tsl/TSLBase.d.ts b/types/three/src/nodes/tsl/TSLBase.d.ts index 43e6ee39b..d934cca2e 100644 --- a/types/three/src/nodes/tsl/TSLBase.d.ts +++ b/types/three/src/nodes/tsl/TSLBase.d.ts @@ -17,6 +17,7 @@ export * from "../gpgpu/ComputeNode.js"; export * from "../math/ConditionalNode.js"; export * from "../math/MathNode.js"; export * from "../math/OperatorNode.js"; +export * from "../utils/DebugNode.js"; export * from "../utils/Discard.js"; export * from "../utils/RemapNode.js"; export * from "./TSLCore.js"; diff --git a/types/three/src/nodes/utils/DebugNode.d.ts b/types/three/src/nodes/utils/DebugNode.d.ts new file mode 100644 index 000000000..03783c717 --- /dev/null +++ b/types/three/src/nodes/utils/DebugNode.d.ts @@ -0,0 +1,20 @@ +import Node from "../core/Node.js"; +import TempNode from "../core/TempNode.js"; +import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; + +declare class DebugNode extends TempNode { + constructor(node: Node, callback?: ((code: string) => void) | null); +} + +export default DebugNode; + +export const debug: ( + node: NodeRepresentation, + callback?: ((code: string) => void) | null, +) => ShaderNodeObject; + +declare module "../tsl/TSLCore.js" { + interface NodeElements { + debug: typeof debug; + } +}