@types/three 0.174.0 → 0.175.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +1 -1
  3. three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
  4. three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  5. three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
  6. three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
  7. three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
  8. three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
  9. three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
  10. three/examples/jsm/transpiler/AST.d.ts +218 -1
  11. three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
  12. three/examples/jsm/webxr/VRButton.d.ts +4 -2
  13. three/package.json +2 -2
  14. three/src/Three.TSL.d.ts +3 -1
  15. three/src/animation/AnimationAction.d.ts +219 -19
  16. three/src/animation/AnimationClip.d.ts +140 -28
  17. three/src/animation/AnimationMixer.d.ts +100 -8
  18. three/src/animation/AnimationObjectGroup.d.ts +55 -14
  19. three/src/animation/AnimationUtils.d.ts +154 -43
  20. three/src/animation/KeyframeTrack.d.ts +134 -25
  21. three/src/animation/PropertyBinding.d.ts +89 -31
  22. three/src/animation/PropertyMixer.d.ts +62 -5
  23. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
  24. three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
  25. three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
  26. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
  27. three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
  28. three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
  29. three/src/constants.d.ts +2 -2
  30. three/src/core/BufferAttribute.d.ts +11 -0
  31. three/src/core/BufferGeometry.d.ts +1 -3
  32. three/src/extras/Controls.d.ts +1 -1
  33. three/src/extras/Earcut.d.ts +5 -3
  34. three/src/extras/ImageUtils.d.ts +1 -0
  35. three/src/lights/PointLight.d.ts +1 -1
  36. three/src/loaders/FileLoader.d.ts +2 -2
  37. three/src/loaders/LoaderUtils.d.ts +0 -5
  38. three/src/materials/Material.d.ts +3 -0
  39. three/src/nodes/Nodes.d.ts +1 -0
  40. three/src/nodes/accessors/BufferAttributeNode.d.ts +11 -4
  41. three/src/nodes/accessors/Object3DNode.d.ts +6 -6
  42. three/src/nodes/accessors/SkinningNode.d.ts +4 -3
  43. three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
  44. three/src/nodes/accessors/TextureNode.d.ts +3 -1
  45. three/src/nodes/code/ExpressionNode.d.ts +3 -2
  46. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  47. three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
  48. three/src/nodes/core/StructTypeNode.d.ts +1 -1
  49. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +1 -12
  50. three/src/nodes/math/ConditionalNode.d.ts +4 -4
  51. three/src/nodes/math/MathNode.d.ts +20 -12
  52. three/src/nodes/math/OperatorNode.d.ts +57 -26
  53. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  54. three/src/nodes/utils/DebugNode.d.ts +20 -0
  55. three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
  56. three/src/renderers/common/Animation.d.ts +2 -2
  57. three/src/renderers/common/Attributes.d.ts +1 -1
  58. three/src/renderers/common/Color4.d.ts +1 -1
  59. three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
  60. three/src/renderers/common/RenderList.d.ts +2 -2
  61. three/src/renderers/common/RenderObject.d.ts +1 -1
  62. three/src/renderers/common/RenderObjects.d.ts +2 -2
  63. three/src/renderers/common/Renderer.d.ts +36 -27
  64. three/src/renderers/common/XRManager.d.ts +69 -3
  65. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
  66. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  67. three/src/textures/CanvasTexture.d.ts +1 -1
  68. three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
@@ -1,10 +1,18 @@
1
1
  import { KeyframeTrack } from "../KeyframeTrack.js";
2
2
 
3
+ /**
4
+ * A track for boolean keyframe values.
5
+ */
3
6
  export class BooleanKeyframeTrack extends KeyframeTrack {
4
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
5
-
6
7
  /**
7
- * @default 'bool'
8
+ * Constructs a new boolean keyframe track.
9
+ *
10
+ * This keyframe track type has no `interpolation` parameter because the
11
+ * interpolation is always discrete.
12
+ *
13
+ * @param {string} name - The keyframe track's name.
14
+ * @param {Array<number>} times - A list of keyframe times.
15
+ * @param {Array<number>} values - A list of keyframe values.
8
16
  */
9
- ValueTypeName: string;
17
+ constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>);
10
18
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for color keyframe values.
6
+ */
4
7
  export class ColorKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'color'
9
+ * Constructs a new color keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for numeric keyframe values.
6
+ */
4
7
  export class NumberKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'number'
9
+ * Constructs a new number keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for Quaternion keyframe values.
6
+ */
4
7
  export class QuaternionKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'quaternion'
9
+ * Constructs a new Quaternion keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -1,10 +1,18 @@
1
1
  import { KeyframeTrack } from "../KeyframeTrack.js";
2
2
 
3
+ /**
4
+ * A track for string keyframe values.
5
+ */
3
6
  export class StringKeyframeTrack extends KeyframeTrack {
4
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
5
-
6
7
  /**
7
- * @default 'string'
8
+ * Constructs a new string keyframe track.
9
+ *
10
+ * This keyframe track type has no `interpolation` parameter because the
11
+ * interpolation is always discrete.
12
+ *
13
+ * @param {string} name - The keyframe track's name.
14
+ * @param {Array<number>} times - A list of keyframe times.
15
+ * @param {Array<number>} values - A list of keyframe values.
8
16
  */
9
- ValueTypeName: string;
17
+ constructor(name: string, times: Array<number>, values: Array<number>);
10
18
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for vector keyframe values.
6
+ */
4
7
  export class VectorKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'vector'
9
+ * Constructs a new vector keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
11
17
  }
three/src/constants.d.ts CHANGED
@@ -420,7 +420,7 @@ export const RGFormat: 1030;
420
420
  export const RGIntegerFormat: 1031;
421
421
 
422
422
  /**
423
- * {@link RGBIntegerFormat} discrads the alpha components and reads the red, green, and blue components.
423
+ * {@link RGBIntegerFormat} discards the alpha components and reads the red, green, and blue components.
424
424
  */
425
425
  export const RGBIntegerFormat: 1032;
426
426
 
@@ -478,7 +478,7 @@ export const RGBA_S3TC_DXT1_Format: 33777;
478
478
  */
479
479
  export const RGBA_S3TC_DXT3_Format: 33778;
480
480
  /**
481
- * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.
481
+ * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs from the DXT3 compression in how the alpha compression is done.
482
482
  * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
483
483
  */
484
484
  export const RGBA_S3TC_DXT5_Format: 33779;
@@ -13,6 +13,17 @@ export type TypedArray =
13
13
  | Float32Array
14
14
  | Float64Array;
15
15
 
16
+ export type TypedArrayConstructor =
17
+ | Int8ArrayConstructor
18
+ | Uint8ArrayConstructor
19
+ | Uint8ClampedArrayConstructor
20
+ | Int16ArrayConstructor
21
+ | Uint16ArrayConstructor
22
+ | Int32ArrayConstructor
23
+ | Uint32ArrayConstructor
24
+ | Float32ArrayConstructor
25
+ | Float64ArrayConstructor;
26
+
16
27
  export interface BufferAttributeJSON {
17
28
  itemSize: number;
18
29
  type: string;
@@ -172,9 +172,7 @@ export class BufferGeometry<
172
172
  * You will have to call {@link dispose | .dispose}(), and create a new instance of {@link THREE.BufferGeometry | BufferGeometry}.
173
173
  * @defaultValue `{}`
174
174
  */
175
- morphAttributes: {
176
- [name: string]: Array<BufferAttribute | InterleavedBufferAttribute>; // TODO Replace for 'Record<>'
177
- };
175
+ morphAttributes: Record<"position" | "normal" | "color", Array<BufferAttribute | InterleavedBufferAttribute>>;
178
176
 
179
177
  /**
180
178
  * Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
@@ -32,7 +32,7 @@ declare abstract class Controls<TEventMap extends {}> extends EventDispatcher<TE
32
32
  * Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event
33
33
  * listeners to the DOM.
34
34
  */
35
- connect(): void;
35
+ connect(element: HTMLElement): void;
36
36
 
37
37
  /**
38
38
  * Disconnects the controls from the DOM.
@@ -5,11 +5,13 @@
5
5
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/Earcut | Official Documentation}
6
6
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js | Source}
7
7
  */
8
- export const Earcut: {
8
+ declare class Earcut {
9
9
  /**
10
10
  * Triangulates the given shape definition by returning an array of triangles
11
11
  * @remarks
12
12
  * A triangle is defined by three consecutive integers representing vertex indices.
13
13
  */
14
- triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
15
- };
14
+ static triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
15
+ }
16
+
17
+ export { Earcut };
@@ -10,6 +10,7 @@ declare class ImageUtils {
10
10
  */
11
11
  static getDataURL(
12
12
  image: HTMLImageElement | HTMLCanvasElement | CanvasImageSource | ImageBitmap | ImageData,
13
+ type?: string,
13
14
  ): string;
14
15
 
15
16
  /**
@@ -22,7 +22,7 @@ import { PointLightShadow } from "./PointLightShadow.js";
22
22
  export class PointLight extends Light<PointLightShadow> {
23
23
  /**
24
24
  * Creates a new PointLight.
25
- * @param color Hexadecimal color of the light. Default is 0xffffff (white). Expects a `Integer`
25
+ * @param color Hexadecimal color of the light. Default is 0xffffff (white). Expects an `Integer`
26
26
  * @param intensity Numeric value of the light's strength/intensity. Expects a `Float`. Default `1`
27
27
  * @param distance Maximum range of the light. Default is 0 (no limit).
28
28
  * @param decay The amount the light dims along the distance of the light. Expects a `Float`. Default `2`
@@ -11,8 +11,8 @@ export class FileLoader extends Loader<string | ArrayBuffer> {
11
11
  onError?: (err: unknown) => void,
12
12
  ): void;
13
13
 
14
- mimeType: string | undefined;
15
- responseType: string | undefined;
14
+ mimeType: string;
15
+ responseType: string;
16
16
 
17
17
  setMimeType(mimeType: string): FileLoader;
18
18
  setResponseType(responseType: string): FileLoader;
@@ -1,9 +1,4 @@
1
1
  export class LoaderUtils {
2
- /**
3
- * @deprecated decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.
4
- */
5
- static decodeText(array: BufferSource): string;
6
-
7
2
  static extractUrlBase(url: string): string;
8
3
 
9
4
  static resolveURL(url: string, path: string): string;
@@ -52,6 +52,7 @@ export interface MaterialParameters {
52
52
  precision?: "highp" | "mediump" | "lowp" | null | undefined;
53
53
  premultipliedAlpha?: boolean | undefined;
54
54
  forceSinglePass?: boolean | undefined;
55
+ allowOverride?: boolean | undefined;
55
56
  dithering?: boolean | undefined;
56
57
  side?: Side | undefined;
57
58
  shadowSide?: Side | undefined;
@@ -479,6 +480,8 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
479
480
  */
480
481
  forceSinglePass: boolean;
481
482
 
483
+ allowOverride: boolean;
484
+
482
485
  /**
483
486
  * Whether to apply dithering to the color to remove the appearance of banding. Default is false.
484
487
  * @default false
@@ -51,6 +51,7 @@ export { NodeUtils };
51
51
  // utils
52
52
  export { default as ArrayElementNode } from "./utils/ArrayElementNode.js";
53
53
  export { default as ConvertNode } from "./utils/ConvertNode.js";
54
+ export { default as DebugNode } from "./utils/DebugNode.js";
54
55
  export { default as EquirectUVNode } from "./utils/EquirectUVNode.js";
55
56
  export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js";
56
57
  export { default as JoinNode } from "./utils/JoinNode.js";
@@ -4,6 +4,8 @@ import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
4
4
  import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
5
5
  import InputNode from "../core/InputNode.js";
6
6
  import NodeBuilder from "../core/NodeBuilder.js";
7
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
8
+ import BufferNode from "./BufferNode.js";
7
9
  /**
8
10
  * In earlier `three.js` versions it was only possible to define attribute data
9
11
  * on geometry level. With `BufferAttributeNode`, it is also possible to do this
@@ -119,7 +121,7 @@ export declare const bufferAttribute: (
119
121
  type?: string | null,
120
122
  stride?: number,
121
123
  offset?: number,
122
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
124
+ ) => ShaderNodeObject<BufferAttributeNode>;
123
125
  /**
124
126
  * TSL function for creating a buffer attribute node but with dynamic draw usage.
125
127
  * Use this function if attribute data are updated per frame.
@@ -137,7 +139,7 @@ export declare const dynamicBufferAttribute: (
137
139
  type?: string | null,
138
140
  stride?: number,
139
141
  offset?: number,
140
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
142
+ ) => ShaderNodeObject<BufferAttributeNode>;
141
143
  /**
142
144
  * TSL function for creating a buffer attribute node but with enabled instancing
143
145
  *
@@ -154,7 +156,7 @@ export declare const instancedBufferAttribute: (
154
156
  type?: string | null,
155
157
  stride?: number,
156
158
  offset?: number,
157
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
159
+ ) => ShaderNodeObject<BufferAttributeNode>;
158
160
  /**
159
161
  * TSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing
160
162
  *
@@ -171,4 +173,9 @@ export declare const instancedDynamicBufferAttribute: (
171
173
  type?: string | null,
172
174
  stride?: number,
173
175
  offset?: number,
174
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
176
+ ) => ShaderNodeObject<BufferAttributeNode>;
177
+ declare module "../tsl/TSLCore.js" {
178
+ interface NodeElements {
179
+ toAttribute: <TValue>(bufferNode: BufferNode<TValue>) => ShaderNodeObject<BufferAttributeNode>;
180
+ }
181
+ }
@@ -16,9 +16,9 @@ export default class Object3DNode extends Node {
16
16
  static RADIUS: "radius";
17
17
  }
18
18
 
19
- export const objectDirection: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
20
- export const objectWorldMatrix: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
21
- export const objectPosition: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
22
- export const objectScale: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
23
- export const objectViewPosition: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
24
- export const objectRadius: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
19
+ export const objectDirection: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
20
+ export const objectWorldMatrix: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
21
+ export const objectPosition: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
22
+ export const objectScale: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
23
+ export const objectViewPosition: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
24
+ export const objectRadius: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
@@ -5,7 +5,6 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
 
6
6
  export default class SkinningNode extends Node {
7
7
  skinnedMesh: SkinnedMesh;
8
- useReference: boolean;
9
8
 
10
9
  skinIndexNode: Node;
11
10
  skinWeightNode: Node;
@@ -13,9 +12,11 @@ export default class SkinningNode extends Node {
13
12
  bindMatrixNode: Node;
14
13
  bindMatrixInverseNode: Node;
15
14
  boneMatricesNode: Node;
15
+ positionNode: Node;
16
+ toPositionNode: Node;
16
17
  previousBoneMatricesNode: Node | null;
17
18
 
18
- constructor(skinnedMesh: SkinnedMesh, useReference?: boolean);
19
+ constructor(skinnedMesh: SkinnedMesh);
19
20
 
20
21
  getSkinnedPosition(boneMatrices?: Node, position?: Node): ShaderNodeObject<Node>;
21
22
 
@@ -27,4 +28,4 @@ export default class SkinningNode extends Node {
27
28
  }
28
29
 
29
30
  export const skinning: (skinnedMesh: SkinnedMesh) => ShaderNodeObject<SkinningNode>;
30
- export const skinningReference: (skinnedMesh: SkinnedMesh) => ShaderNodeObject<SkinningNode>;
31
+ export const computeSkinning: (skinnedMesh: SkinnedMesh, toPosition?: Node | null) => ShaderNodeObject<SkinningNode>;
@@ -31,12 +31,12 @@ export default class StorageTextureNode extends TextureNode {
31
31
 
32
32
  export const storageTexture: (
33
33
  value: Texture,
34
- uvNode?: NodeRepresentation,
34
+ uvNode?: NodeRepresentation | null,
35
35
  storeNode?: NodeRepresentation,
36
36
  ) => ShaderNodeObject<StorageTextureNode>;
37
37
 
38
38
  export const textureStore: (
39
39
  value: Texture,
40
- uvNode?: NodeRepresentation,
40
+ uvNode?: NodeRepresentation | null,
41
41
  storeNode?: NodeRepresentation,
42
42
  ) => ShaderNodeObject<StorageTextureNode>;
@@ -68,4 +68,6 @@ export const textureLoad: (
68
68
  biasNode?: NodeRepresentation,
69
69
  ) => ShaderNodeObject<TextureNode>;
70
70
 
71
- export const sampler: (aTexture: Texture | TextureNode) => ShaderNodeObject<Node>;
71
+ export const sampler: (value: Texture | TextureNode) => ShaderNodeObject<Node>;
72
+
73
+ export const samplerComparison: (value: Texture | TextureNode) => ShaderNodeObject<Node>;
@@ -2,8 +2,9 @@ import TempNode from "../core/TempNode.js";
2
2
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class ExpressionNode extends TempNode {
5
- snipped: string; /* sic */
5
+ snipped: string;
6
+
6
7
  constructor(snipped?: string, nodeType?: string);
7
8
  }
8
9
 
9
- export const expression: (snipped?: string, nodeType?: string) => ShaderNodeObject<ExpressionNode>;
10
+ export const expression: (snipped: string, nodeType?: string) => ShaderNodeObject<ExpressionNode>;
@@ -17,6 +17,6 @@ declare class ScriptableNode extends Node {
17
17
  export default ScriptableNode;
18
18
 
19
19
  export const scriptable: (
20
- codeNode?: NodeRepresentation | null,
20
+ codeNode: NodeRepresentation,
21
21
  parameters?: Record<string, unknown>,
22
22
  ) => ShaderNodeObject<ScriptableNode>;
@@ -7,4 +7,4 @@ declare class ScriptableValueNode extends Node {
7
7
 
8
8
  export default ScriptableValueNode;
9
9
 
10
- export const scriptableValue: (value?: unknown) => ShaderNodeObject<ScriptableValueNode>;
10
+ export const scriptableValue: (value: unknown) => ShaderNodeObject<ScriptableValueNode>;
@@ -28,7 +28,7 @@ declare class StructTypeNode extends Node {
28
28
  * Creates an instance of StructTypeNode.
29
29
  *
30
30
  * @param {Object} membersLayout - The layout of the members for the struct.
31
- * @param {string} [name=null] - The optional name of the struct.
31
+ * @param {?string} [name=null] - The optional name of the struct.
32
32
  */
33
33
  constructor(membersLayout: MembersLayout, name?: string | null);
34
34
  /**
@@ -17,9 +17,8 @@ declare class AtomicFunctionNode extends TempNode {
17
17
  method: AtomicMethod;
18
18
  pointerNode: Node;
19
19
  valueNode: Node;
20
- storeNode: Node;
21
20
 
22
- constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node, storeNode?: Node | null);
21
+ constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node);
23
22
 
24
23
  static ATOMIC_LOAD: "atomicLoad";
25
24
  static ATOMIC_STORE: "atomicStore";
@@ -36,58 +35,48 @@ export const atomicFunc: (
36
35
  method: AtomicMethod,
37
36
  pointerNode: NodeRepresentation,
38
37
  valueNode: NodeRepresentation,
39
- storeNode?: NodeRepresentation | null,
40
38
  ) => ShaderNodeObject<AtomicFunctionNode>;
41
39
 
42
40
  export const atomicLoad: (
43
41
  pointerNode: NodeRepresentation,
44
- storeNode?: NodeRepresentation | null,
45
42
  ) => ShaderNodeObject<AtomicFunctionNode>;
46
43
 
47
44
  export const atomicStore: (
48
45
  pointerNode: NodeRepresentation,
49
46
  valueNode: NodeRepresentation,
50
- storeNode?: NodeRepresentation | null,
51
47
  ) => ShaderNodeObject<AtomicFunctionNode>;
52
48
 
53
49
  export const atomicAdd: (
54
50
  pointerNode: NodeRepresentation,
55
51
  valueNode: NodeRepresentation,
56
- storeNode?: NodeRepresentation | null,
57
52
  ) => ShaderNodeObject<AtomicFunctionNode>;
58
53
 
59
54
  export const atomicSub: (
60
55
  pointerNode: NodeRepresentation,
61
56
  valueNode: NodeRepresentation,
62
- storeNode?: NodeRepresentation | null,
63
57
  ) => ShaderNodeObject<AtomicFunctionNode>;
64
58
 
65
59
  export const atomicMax: (
66
60
  pointerNode: NodeRepresentation,
67
61
  valueNode: NodeRepresentation,
68
- storeNode?: NodeRepresentation | null,
69
62
  ) => ShaderNodeObject<AtomicFunctionNode>;
70
63
 
71
64
  export const atomicMin: (
72
65
  pointerNode: NodeRepresentation,
73
66
  valueNode: NodeRepresentation,
74
- storeNode?: NodeRepresentation | null,
75
67
  ) => ShaderNodeObject<AtomicFunctionNode>;
76
68
 
77
69
  export const atomicAnd: (
78
70
  pointerNode: NodeRepresentation,
79
71
  valueNode: NodeRepresentation,
80
- storeNode?: NodeRepresentation | null,
81
72
  ) => ShaderNodeObject<AtomicFunctionNode>;
82
73
 
83
74
  export const atomicOr: (
84
75
  pointerNode: NodeRepresentation,
85
76
  valueNode: NodeRepresentation,
86
- storeNode?: NodeRepresentation | null,
87
77
  ) => ShaderNodeObject<AtomicFunctionNode>;
88
78
 
89
79
  export const atomicXor: (
90
80
  pointerNode: NodeRepresentation,
91
81
  valueNode: NodeRepresentation,
92
- storeNode?: NodeRepresentation | null,
93
82
  ) => ShaderNodeObject<AtomicFunctionNode>;
@@ -4,9 +4,9 @@ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  declare class ConditionalNode extends Node {
5
5
  condNode: Node;
6
6
  ifNode: Node;
7
- elseNode: Node;
7
+ elseNode: Node | null;
8
8
 
9
- constructor(condNode: Node, ifNode: Node, elseNode: Node);
9
+ constructor(condNode: Node, ifNode: Node, elseNode?: Node | null);
10
10
  }
11
11
 
12
12
  export default ConditionalNode;
@@ -14,7 +14,7 @@ export default ConditionalNode;
14
14
  export const select: (
15
15
  condNode: NodeRepresentation,
16
16
  ifNode: NodeRepresentation,
17
- elseNode: NodeRepresentation,
17
+ elseNode?: NodeRepresentation | null,
18
18
  ) => ShaderNodeObject<Node>;
19
19
 
20
20
  declare module "../tsl/TSLCore.js" {
@@ -29,7 +29,7 @@ declare module "../tsl/TSLCore.js" {
29
29
  export const cond: (
30
30
  condNode: NodeRepresentation,
31
31
  ifNode: NodeRepresentation,
32
- elseNode: NodeRepresentation,
32
+ elseNode?: NodeRepresentation | null,
33
33
  ) => ShaderNodeObject<Node>;
34
34
 
35
35
  declare module "../tsl/TSLCore.js" {
@@ -39,7 +39,6 @@ export type MathNodeMethod1 =
39
39
  export type MathNodeMethod2 =
40
40
  | typeof MathNode.MIN
41
41
  | typeof MathNode.MAX
42
- | typeof MathNode.MOD
43
42
  | typeof MathNode.STEP
44
43
  | typeof MathNode.REFLECT
45
44
  | typeof MathNode.DISTANCE
@@ -100,7 +99,6 @@ export default class MathNode extends TempNode {
100
99
 
101
100
  static MIN: "min";
102
101
  static MAX: "max";
103
- static MOD: "mod";
104
102
  static STEP: "step";
105
103
  static REFLECT: "reflect";
106
104
  static DISTANCE: "distance";
@@ -138,6 +136,10 @@ type Unary = (a: NodeRepresentation) => ShaderNodeObject<MathNode>;
138
136
 
139
137
  export const all: Unary;
140
138
  export const any: Unary;
139
+
140
+ /**
141
+ * @deprecated "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"
142
+ */
141
143
  export const equals: Unary;
142
144
 
143
145
  export const radians: Unary;
@@ -169,14 +171,21 @@ export const round: Unary;
169
171
  export const reciprocal: Unary;
170
172
  export const trunc: Unary;
171
173
  export const fwidth: Unary;
172
- export const bitcast: Unary;
173
174
  export const transpose: Unary;
174
175
 
175
176
  type Binary = (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
176
177
 
177
- export const min: Binary;
178
- export const max: Binary;
179
- export const mod: Binary;
178
+ export const bitcast: Binary;
179
+ export const min: (
180
+ x: NodeRepresentation,
181
+ y: NodeRepresentation,
182
+ ...values: NodeRepresentation[]
183
+ ) => ShaderNodeObject<MathNode>;
184
+ export const max: (
185
+ x: NodeRepresentation,
186
+ y: NodeRepresentation,
187
+ ...values: NodeRepresentation[]
188
+ ) => ShaderNodeObject<MathNode>;
180
189
  export const step: Binary;
181
190
  export const reflect: Binary;
182
191
  export const distance: Binary;
@@ -184,15 +193,15 @@ export const difference: Binary;
184
193
  export const dot: Binary;
185
194
  export const cross: Binary;
186
195
  export const pow: Binary;
187
- export const pow2: Binary;
188
- export const pow3: Binary;
189
- export const pow4: Binary;
196
+ export const pow2: Unary;
197
+ export const pow3: Unary;
198
+ export const pow4: Unary;
190
199
  export const transformDirection: Binary;
200
+ export const cbrt: Unary;
201
+ export const lengthSq: Unary;
191
202
 
192
203
  type Ternary = (a: NodeRepresentation, b: NodeRepresentation, c: NodeRepresentation) => ShaderNodeObject<MathNode>;
193
204
 
194
- export const cbrt: Unary;
195
- export const lengthSq: Unary;
196
205
  export const mix: Ternary;
197
206
  export const clamp: (
198
207
  a: NodeRepresentation,
@@ -259,7 +268,6 @@ declare module "../tsl/TSLCore.js" {
259
268
  atan2: typeof atan2;
260
269
  min: typeof min;
261
270
  max: typeof max;
262
- mod: typeof mod;
263
271
  step: typeof step;
264
272
  reflect: typeof reflect;
265
273
  distance: typeof distance;