@types/three 0.183.0 → 0.184.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 (128) hide show
  1. three/README.md +2 -2
  2. three/examples/jsm/Addons.d.ts +11 -0
  3. three/examples/jsm/controls/FirstPersonControls.d.ts +5 -10
  4. three/examples/jsm/controls/TransformControls.d.ts +24 -0
  5. three/examples/jsm/geometries/TextGeometry.d.ts +43 -71
  6. three/examples/jsm/helpers/LightProbeGridHelper.d.ts +12 -0
  7. three/examples/jsm/inspector/Extension.d.ts +9 -0
  8. three/examples/jsm/inspector/Inspector.d.ts +21 -2
  9. three/examples/jsm/inspector/RendererInspector.d.ts +7 -2
  10. three/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.d.ts +20 -0
  11. three/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.d.ts +11 -0
  12. three/examples/jsm/inspector/tabs/Parameters.d.ts +22 -1
  13. three/examples/jsm/inspector/ui/Tab.d.ts +5 -1
  14. three/examples/jsm/inspector/ui/Values.d.ts +23 -3
  15. three/examples/jsm/interaction/InteractionManager.d.ts +18 -0
  16. three/examples/jsm/lighting/DynamicLighting.d.ts +16 -0
  17. three/examples/jsm/lighting/LightProbeGrid.d.ts +34 -0
  18. three/examples/jsm/loaders/ColladaLoader.d.ts +1 -0
  19. three/examples/jsm/loaders/EXRLoader.d.ts +2 -0
  20. three/examples/jsm/loaders/LDrawLoader.d.ts +1 -1
  21. three/examples/jsm/loaders/VTKLoader.d.ts +6 -0
  22. three/examples/jsm/objects/Reflector.d.ts +1 -2
  23. three/examples/jsm/objects/SkyMesh.d.ts +1 -0
  24. three/examples/jsm/tsl/WebGLNodesHandler.d.ts +14 -0
  25. three/examples/jsm/tsl/display/FSR1Node.d.ts +17 -0
  26. three/examples/jsm/tsl/display/SharpenNode.d.ts +22 -0
  27. three/examples/jsm/tsl/display/TAAUNode.d.ts +31 -0
  28. three/examples/jsm/tsl/lighting/DynamicLightsNode.d.ts +21 -0
  29. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +1 -1
  30. three/examples/jsm/tsl/lighting/data/AmbientLightDataNode.d.ts +9 -0
  31. three/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.d.ts +9 -0
  32. three/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.d.ts +9 -0
  33. three/examples/jsm/tsl/lighting/data/PointLightDataNode.d.ts +9 -0
  34. three/examples/jsm/tsl/lighting/data/SpotLightDataNode.d.ts +9 -0
  35. three/examples/jsm/utils/ColorUtils.d.ts +5 -0
  36. three/examples/jsm/utils/SceneOptimizer.d.ts +18 -0
  37. three/examples/jsm/webxr/XRHandMeshModel.d.ts +1 -0
  38. three/package.json +4 -5
  39. three/src/Three.Core.d.ts +13 -1
  40. three/src/Three.TSL.d.ts +7 -1
  41. three/src/Three.WebGPU.Nodes.d.ts +8 -4
  42. three/src/Three.WebGPU.d.ts +11 -4
  43. three/src/Three.d.ts +0 -11
  44. three/src/animation/AnimationMixer.d.ts +3 -1
  45. three/src/audio/AudioContext.d.ts +2 -2
  46. three/src/core/BufferAttribute.d.ts +13 -1
  47. three/src/core/RenderTarget.d.ts +8 -1
  48. three/src/core/UniformsGroup.d.ts +7 -1
  49. three/src/extras/Controls.d.ts +5 -1
  50. three/src/geometries/ExtrudeGeometry.d.ts +39 -53
  51. three/src/loaders/FileLoader.d.ts +2 -2
  52. three/src/materials/Material.d.ts +5 -1
  53. three/src/materials/MeshToonMaterial.d.ts +1 -1
  54. three/src/materials/nodes/Line2NodeMaterial.d.ts +7 -0
  55. three/src/materials/nodes/VolumeNodeMaterial.d.ts +1 -1
  56. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +11 -1
  57. three/src/math/ColorManagement.d.ts +1 -1
  58. three/src/math/Matrix2.d.ts +1 -1
  59. three/src/math/Matrix3.d.ts +1 -1
  60. three/src/math/Matrix4.d.ts +1 -1
  61. three/src/math/Plane.d.ts +1 -1
  62. three/src/math/Vector2.d.ts +2 -1
  63. three/src/math/Vector3.d.ts +2 -1
  64. three/src/math/Vector4.d.ts +2 -1
  65. three/src/nodes/Nodes.d.ts +0 -1
  66. three/src/nodes/TSL.d.ts +1 -1
  67. three/src/nodes/accessors/BufferAttributeNode.d.ts +1 -1
  68. three/src/nodes/core/Node.d.ts +37 -9
  69. three/src/nodes/core/StackNode.d.ts +1 -1
  70. three/src/nodes/core/StructTypeNode.d.ts +0 -4
  71. three/src/nodes/core/UniformGroupNode.d.ts +4 -3
  72. three/src/nodes/core/UniformNode.d.ts +3 -0
  73. three/src/nodes/core/VarNode.d.ts +16 -10
  74. three/src/nodes/display/ViewportDepthTextureNode.d.ts +1 -3
  75. three/src/nodes/display/ViewportTextureNode.d.ts +5 -5
  76. three/src/nodes/functions/ShadowMaskModel.d.ts +2 -2
  77. three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
  78. three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +16 -7
  79. three/src/nodes/gpgpu/ComputeNode.d.ts +6 -2
  80. three/src/nodes/materialx/lib/mx_noise.d.ts +4 -5
  81. three/src/nodes/math/MathNode.d.ts +64 -6
  82. three/src/nodes/tsl/TSLBase.d.ts +1 -1
  83. three/src/nodes/tsl/TSLCore.d.ts +568 -160
  84. three/src/nodes/utils/ConvertNode.d.ts +9 -2
  85. three/src/nodes/utils/EventNode.d.ts +6 -0
  86. three/src/nodes/utils/JoinNode.d.ts +9 -5
  87. three/src/nodes/utils/LoopNode.d.ts +1 -2
  88. three/src/nodes/utils/{RemapNode.d.ts → Remap.d.ts} +6 -22
  89. three/src/objects/BatchedMesh.d.ts +2 -0
  90. three/src/objects/InstancedMesh.d.ts +6 -6
  91. three/src/objects/SkinnedMesh.d.ts +3 -0
  92. three/src/renderers/WebGLRenderer.d.ts +10 -1
  93. three/src/renderers/common/Animation.d.ts +2 -2
  94. three/src/renderers/common/Attributes.d.ts +9 -1
  95. three/src/renderers/common/Backend.d.ts +4 -0
  96. three/src/renderers/common/Background.d.ts +2 -2
  97. three/src/renderers/common/BindGroup.d.ts +0 -6
  98. three/src/renderers/common/Bindings.d.ts +2 -2
  99. three/src/renderers/common/CanvasTarget.d.ts +3 -1
  100. three/src/renderers/common/ComputePipeline.d.ts +1 -1
  101. three/src/renderers/common/Info.d.ts +132 -1
  102. three/src/renderers/common/InspectorBase.d.ts +7 -1
  103. three/src/renderers/common/Pipelines.d.ts +19 -3
  104. three/src/renderers/common/ReadbackBuffer.d.ts +63 -0
  105. three/src/renderers/common/RenderBundle.d.ts +4 -1
  106. three/src/renderers/common/RenderBundles.d.ts +3 -1
  107. three/src/renderers/common/RenderObject.d.ts +2 -2
  108. three/src/renderers/common/RenderObjects.d.ts +3 -3
  109. three/src/renderers/common/RenderPipeline.d.ts +24 -0
  110. three/src/renderers/common/Renderer.d.ts +29 -16
  111. three/src/renderers/common/XRManager.d.ts +1 -7
  112. three/src/renderers/common/nodes/NodeManager.d.ts +51 -11
  113. three/src/renderers/shaders/ShaderChunk.d.ts +1 -0
  114. three/src/renderers/shaders/UniformsLib.d.ts +5 -1
  115. three/src/renderers/webgl/WebGLBufferRenderer.d.ts +0 -6
  116. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +0 -6
  117. three/src/renderers/webgl/WebGLPrograms.d.ts +5 -0
  118. three/src/renderers/webgl-fallback/WebGLBackend.d.ts +2 -0
  119. three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +19 -0
  120. three/src/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts +51 -0
  121. three/src/renderers/webgpu/WebGPUBackend.d.ts +9 -4
  122. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +6 -0
  123. three/src/renderers/webxr/WebXRController.d.ts +5 -1
  124. three/src/renderers/webxr/WebXRManager.d.ts +3 -1
  125. three/src/scenes/Scene.d.ts +2 -2
  126. three/src/textures/ExternalTexture.d.ts +3 -2
  127. three/src/textures/HTMLTexture.d.ts +27 -0
  128. three/src/textures/Texture.d.ts +16 -1
@@ -1,8 +1,8 @@
1
1
  import LightingModel from "../core/LightingModel.js";
2
- import VarNode from "../core/VarNode.js";
2
+ import Node from "../core/Node.js";
3
3
 
4
4
  export default class ShadowMaskModel extends LightingModel {
5
- shadowNode: VarNode;
5
+ shadowNode: Node;
6
6
 
7
7
  constructor();
8
8
  }
@@ -3,6 +3,8 @@ import Node from "../core/Node.js";
3
3
  declare class BarrierNode extends Node {
4
4
  scope: string;
5
5
 
6
+ readonly isBarrierNode: boolean;
7
+
6
8
  constructor(scope: string);
7
9
  }
8
10
 
@@ -1,13 +1,22 @@
1
1
  import Node from "../core/Node.js";
2
+ import { NodeBuilder } from "../Nodes.js";
2
3
 
3
- declare class ComputeBuiltinNode extends Node {
4
- constructor(builtinName: string, nodeType: string);
4
+ interface ComputeBuiltinNodeInterface {
5
+ setBuiltinName(builtinName: string): this;
6
+ getBuiltinName(builder: NodeBuilder): string;
7
+ hasBuiltin(builder: NodeBuilder): boolean;
5
8
  }
6
9
 
10
+ declare const ComputeBuiltinNode: {
11
+ new<TNodeType>(builtinName: string, nodeType: TNodeType): ComputeBuiltinNode<TNodeType>;
12
+ };
13
+
14
+ type ComputeBuiltinNode<TNodeType = unknown> = Node<TNodeType> & ComputeBuiltinNodeInterface;
15
+
7
16
  export default ComputeBuiltinNode;
8
17
 
9
- export const numWorkgroups: ComputeBuiltinNode;
10
- export const workgroupId: ComputeBuiltinNode;
11
- export const globalId: ComputeBuiltinNode;
12
- export const localId: ComputeBuiltinNode;
13
- export const subgroupSize: ComputeBuiltinNode;
18
+ export const numWorkgroups: ComputeBuiltinNode<"uvec3">;
19
+ export const workgroupId: ComputeBuiltinNode<"uvec3">;
20
+ export const globalId: ComputeBuiltinNode<"uvec3">;
21
+ export const localId: ComputeBuiltinNode<"uvec3">;
22
+ export const subgroupSize: ComputeBuiltinNode<"uint">;
@@ -1,16 +1,20 @@
1
1
  import Renderer from "../../renderers/common/Renderer.js";
2
2
  import Node from "../core/Node.js";
3
+ import UniformNode from "../core/UniformNode.js";
3
4
 
4
5
  export default class ComputeNode extends Node {
5
- readonly isComputeNode: true;
6
+ readonly isComputeNode: boolean;
6
7
 
7
8
  computeNode: Node;
8
9
  workgroupSize: number[];
9
10
  count: number | number[] | null;
11
+ dispatchSize: number | number[] | null;
10
12
  name: string;
11
13
 
12
14
  onInitFunction: ((args: { renderer: Renderer }) => void) | null;
13
15
 
16
+ countNode: UniformNode<"uint", number> | null;
17
+
14
18
  constructor(computeNode: Node, workgroupSize: number[]);
15
19
 
16
20
  setCount(count: number | number[]): this;
@@ -23,7 +27,7 @@ export default class ComputeNode extends Node {
23
27
  */
24
28
  label: (name: string) => this;
25
29
 
26
- onInit(callback: ((args: { renderer: Renderer }) => void) | null): void;
30
+ onInit(callback: ((args: { renderer: Renderer }) => void) | null): this;
27
31
  }
28
32
 
29
33
  export const computeKernel: (node: Node, workgroupSize?: number[]) => ComputeNode;
@@ -1,5 +1,4 @@
1
1
  import Node from "../../core/Node.js";
2
- import VarNode from "../../core/VarNode.js";
3
2
 
4
3
  export const mx_select: (
5
4
  b_immutable: Node | boolean,
@@ -14,7 +13,7 @@ export const mx_negate_if: (
14
13
 
15
14
  export const mx_floor: (x_immutable: Node | number) => Node;
16
15
 
17
- export const mx_floorfrac: (x_immutable: Node | number, i: VarNode) => Node;
16
+ export const mx_floorfrac: (x_immutable: Node | number, i: Node) => Node;
18
17
 
19
18
  export const mx_bilerp_0: (
20
19
  v0_immutable: Node | number,
@@ -140,9 +139,9 @@ export const mx_gradient_scale3d: (v_immutable: Node | number) => Node;
140
139
  export const mx_rotl32: (x_immutable: Node | number, k_immutable: Node | number) => Node;
141
140
 
142
141
  export const mx_bjmix: (
143
- a: VarNode,
144
- b: VarNode,
145
- c: VarNode,
142
+ a: Node,
143
+ b: Node,
144
+ c: Node,
146
145
  ) => Node;
147
146
 
148
147
  export const mx_bjfinal: (
@@ -18,11 +18,17 @@ export type MathNodeMethod1 =
18
18
  | typeof MathNode.NORMALIZE
19
19
  | typeof MathNode.FRACT
20
20
  | typeof MathNode.SIN
21
+ | typeof MathNode.SINH
21
22
  | typeof MathNode.COS
23
+ | typeof MathNode.COSH
22
24
  | typeof MathNode.TAN
25
+ | typeof MathNode.TANH
23
26
  | typeof MathNode.ASIN
27
+ | typeof MathNode.ASINH
24
28
  | typeof MathNode.ACOS
29
+ | typeof MathNode.ACOSH
25
30
  | typeof MathNode.ATAN
31
+ | typeof MathNode.ATANH
26
32
  | typeof MathNode.ABS
27
33
  | typeof MathNode.SIGN
28
34
  | typeof MathNode.LENGTH
@@ -77,11 +83,17 @@ export default class MathNode extends TempNode {
77
83
  static NORMALIZE: "normalize";
78
84
  static FRACT: "fract";
79
85
  static SIN: "sin";
86
+ static SINH: "sinh";
80
87
  static COS: "cos";
88
+ static COSH: "cosh";
81
89
  static TAN: "tan";
90
+ static TANH: "tanh";
82
91
  static ASIN: "asin";
92
+ static ASINH: "asinh";
83
93
  static ACOS: "acos";
94
+ static ACOSH: "acosh";
84
95
  static ATAN: "atan";
96
+ static ATANH: "atanh";
85
97
  static ABS: "abs";
86
98
  static SIGN: "sign";
87
99
  static LENGTH: "length";
@@ -236,20 +248,66 @@ declare module "../core/Node.js" {
236
248
  }
237
249
  }
238
250
 
239
- export const sin: (x: FloatOrNumber) => Node<"float">;
240
- export const cos: (x: FloatOrNumber) => Node<"float">;
241
- export const tan: (x: FloatOrNumber) => Node<"float">;
242
- export const asin: (x: FloatOrNumber) => Node<"float">;
243
- export const acos: (x: FloatOrNumber) => Node<"float">;
244
- export const atan: (y: FloatOrNumber, x?: FloatOrNumber) => Node<"float">;
251
+ interface TrigonometricFunction {
252
+ (x: FloatOrNumber): Node<"float">;
253
+ (x: Node<"vec2">): Node<"vec2">;
254
+ (x: Node<"vec3">): Node<"vec3">;
255
+ (x: Node<"vec4">): Node<"vec4">;
256
+ }
257
+ interface ArcTanFunction {
258
+ (y: FloatOrNumber, x?: FloatOrNumber): Node<"float">;
259
+ (y: Node<"vec2">, x?: Vec2OrLessOrFloat): Node<"vec2">;
260
+ (y: Node<"vec3">, x?: Vec3OrLessOrFloat): Node<"vec3">;
261
+ (y: Node<"vec4">, x?: Vec4OrLessOrFloat): Node<"vec4">;
262
+ }
263
+ export const sin: TrigonometricFunction;
264
+ export const sinh: TrigonometricFunction;
265
+ export const cos: TrigonometricFunction;
266
+ export const cosh: TrigonometricFunction;
267
+ export const tan: TrigonometricFunction;
268
+ export const tanh: TrigonometricFunction;
269
+ export const asin: TrigonometricFunction;
270
+ export const asinh: TrigonometricFunction;
271
+ export const acos: TrigonometricFunction;
272
+ export const acosh: TrigonometricFunction;
273
+ export const atan: ArcTanFunction;
274
+ export const atanh: TrigonometricFunction;
245
275
  declare module "../core/Node.js" {
246
276
  interface FloatExtensions {
247
277
  sin: () => Node<"float">;
278
+ sinh: () => Node<"float">;
248
279
  cos: () => Node<"float">;
280
+ cosh: () => Node<"float">;
249
281
  tan: () => Node<"float">;
282
+ tanh: () => Node<"float">;
250
283
  asin: () => Node<"float">;
284
+ asinh: () => Node<"float">;
251
285
  acos: () => Node<"float">;
286
+ acosh: () => Node<"float">;
252
287
  atan: (x?: FloatOrNumber) => Node<"float">;
288
+ atanh: () => Node<"float">;
289
+ }
290
+ interface FloatVecExtensions<TVec extends FloatVecType> {
291
+ sin: () => Node<TVec>;
292
+ sinh: () => Node<TVec>;
293
+ cos: () => Node<TVec>;
294
+ cosh: () => Node<TVec>;
295
+ tan: () => Node<TVec>;
296
+ tanh: () => Node<TVec>;
297
+ asin: () => Node<TVec>;
298
+ asinh: () => Node<TVec>;
299
+ acos: () => Node<TVec>;
300
+ acosh: () => Node<TVec>;
301
+ atanh: () => Node<TVec>;
302
+ }
303
+ interface Vec2Extensions {
304
+ atan: (x?: Vec2OrLessOrFloat) => Node<"vec2">;
305
+ }
306
+ interface Vec3Extensions {
307
+ atan: (x?: Vec3OrLessOrFloat) => Node<"vec3">;
308
+ }
309
+ interface Vec4Extensions {
310
+ atan: (x?: Vec4OrLessOrFloat) => Node<"vec4">;
253
311
  }
254
312
  }
255
313
 
@@ -21,7 +21,7 @@ export * from "../math/MathNode.js";
21
21
  export * from "../math/OperatorNode.js";
22
22
  export * from "../utils/DebugNode.js";
23
23
  export * from "../utils/Discard.js";
24
- export * from "../utils/RemapNode.js";
24
+ export * from "../utils/Remap.js";
25
25
  export * from "./TSLCore.js";
26
26
 
27
27
  /**