@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
three/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 27 Feb 2025 18:02:49 GMT
11
+ * Last updated: Fri, 28 Mar 2025 18:39:32 GMT
12
12
  * Dependencies: [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [@webgpu/types](https://npmjs.com/package/@webgpu/types), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
13
13
 
14
14
  # Credits
@@ -46,7 +46,7 @@ export * from "./exporters/USDZExporter.js";
46
46
  export * from "./geometries/BoxLineGeometry.js";
47
47
  export * from "./geometries/ConvexGeometry.js";
48
48
  export * from "./geometries/DecalGeometry.js";
49
- export * from "./geometries/ParametricGeometries.js";
49
+ export * from "./geometries/ParametricFunctions.js";
50
50
  export * from "./geometries/ParametricGeometry.js";
51
51
  export * from "./geometries/RoundedBoxGeometry.js";
52
52
  export * from "./geometries/TeapotGeometry.js";
@@ -74,8 +74,11 @@ declare class PointerLockControls extends Controls<PointerLockControlsEventMap>
74
74
 
75
75
  /**
76
76
  * Activates the pointer lock.
77
+ *
78
+ * @param {boolean} [unadjustedMovement=false] - Disables OS-level adjustment for mouse acceleration, and accesses raw mouse input instead.
79
+ * Setting it to true will disable mouse acceleration.
77
80
  */
78
- lock(): void;
81
+ lock(unadjustedMovement?: boolean): void;
79
82
 
80
83
  /**
81
84
  * Exits the pointer lock.
@@ -0,0 +1,8 @@
1
+ import { Vector3 } from "three";
2
+
3
+ declare function klein(v: number, u: number, target: Vector3): void;
4
+ declare function plane(u: number, v: number, target: Vector3): void;
5
+ declare function mobius(u: number, t: number, target: Vector3): void;
6
+ declare function mobius3d(u: number, t: number, target: Vector3): void;
7
+
8
+ export { klein, mobius, mobius3d, plane };
@@ -1,6 +1,13 @@
1
- import { Mesh, MeshBasicMaterial, PlaneGeometry } from "three";
1
+ import { Mesh, MeshBasicMaterial, Object3DEventMap, PlaneGeometry } from "three";
2
2
 
3
- export class HTMLMesh extends Mesh<PlaneGeometry, MeshBasicMaterial> {
3
+ export interface HTMLMeshEventMap extends Object3DEventMap {
4
+ mousedown: { data: { x: number; y: number } };
5
+ mousemove: { data: { x: number; y: number } };
6
+ mouseup: { data: { x: number; y: number } };
7
+ click: { data: { x: number; y: number } };
8
+ }
9
+
10
+ export class HTMLMesh extends Mesh<PlaneGeometry, MeshBasicMaterial, HTMLMeshEventMap> {
4
11
  constructor(dom: HTMLElement);
5
12
  dispose(): void;
6
13
  }
@@ -1,4 +1,4 @@
1
- import { Data3DTexture, Loader, Texture } from "three";
1
+ import { Data3DTexture, Loader, LoadingManager, Texture } from "three";
2
2
 
3
3
  export interface LUTImageResult {
4
4
  size: number;
@@ -8,7 +8,7 @@ export interface LUTImageResult {
8
8
  export class LUTImageLoader extends Loader<LUTImageResult> {
9
9
  flip: boolean;
10
10
 
11
- constructor(flipVertical?: boolean);
11
+ constructor(manager?: LoadingManager);
12
12
 
13
13
  getImageData(texture: Texture): ImageData;
14
14
 
@@ -16,7 +16,7 @@ export interface HalftonePassParameters {
16
16
  }
17
17
 
18
18
  export class HalftonePass extends Pass {
19
- constructor(width: number, height: number, params: HalftonePassParameters);
19
+ constructor(params: HalftonePassParameters);
20
20
  uniforms: {
21
21
  tDiffuse: IUniform;
22
22
  shape: IUniform<number>;
@@ -9,5 +9,5 @@ export interface LUTPassParameters {
9
9
  export class LUTPass extends ShaderPass {
10
10
  lut?: DataTexture | Data3DTexture;
11
11
  intensity?: number;
12
- constructor(params: LUTPassParameters);
12
+ constructor(params?: LUTPassParameters);
13
13
  }
@@ -3,7 +3,7 @@ import { ShaderMaterial, Texture, WebGLRenderTarget } from "three";
3
3
  import { FullScreenQuad, Pass } from "./Pass.js";
4
4
 
5
5
  export class SMAAPass extends Pass {
6
- constructor(width: number, height: number);
6
+ constructor();
7
7
  edgesRT: WebGLRenderTarget;
8
8
  weightsRT: WebGLRenderTarget;
9
9
  areaTexture: Texture;
@@ -1,7 +1,224 @@
1
1
  export class Program {
2
- body: unknown[];
2
+ constructor();
3
+
4
+ body: Statement[];
3
5
 
4
6
  isProgram: true;
7
+ }
8
+
9
+ // Boolean seems to be handled as a Unary
10
+ export type Statement =
11
+ | VariableDeclaration
12
+ | Uniform
13
+ | Varying
14
+ | FunctionParameter
15
+ | FunctionDeclaration
16
+ | Expression
17
+ | Ternary
18
+ | Operator
19
+ | Unary
20
+ | Number
21
+ | String
22
+ | Conditional
23
+ | FunctionCall
24
+ | Return
25
+ | Discard
26
+ | Accessor
27
+ | StaticElement
28
+ | DynamicElement
29
+ | AccessorElements
30
+ | For
31
+ | null;
32
+
33
+ export class VariableDeclaration {
34
+ constructor(
35
+ type: string,
36
+ name: string,
37
+ value?: Accessor | null,
38
+ next?: VariableDeclaration | null,
39
+ immutable?: boolean,
40
+ );
41
+
42
+ type: string;
43
+ name: string;
44
+ value: Accessor | null;
45
+ next: VariableDeclaration | null;
46
+
47
+ immutable: boolean;
48
+
49
+ isVariableDeclaration: true;
50
+ }
51
+
52
+ export class Uniform {
53
+ constructor(type: string, name: string);
54
+
55
+ type: string;
56
+ name: string;
57
+
58
+ isUniform: true;
59
+ }
60
+
61
+ export class Varying {
62
+ constructor(type: string, name: string);
63
+
64
+ type: string;
65
+ name: string;
66
+
67
+ isVarying: true;
68
+ }
69
+
70
+ export class FunctionParameter {
71
+ constructor(type: string, name: string, qualifier?: string | null, immutable?: boolean);
72
+
73
+ type: string;
74
+ name: string;
75
+ qualifier: string | null;
76
+ immutable: boolean;
77
+
78
+ isFunctionParameter: true;
79
+ }
80
+
81
+ export class FunctionDeclaration {
82
+ constructor(type: string, name: string, params?: FunctionParameter[]);
83
+
84
+ type: string;
85
+ name: string;
86
+ params: FunctionParameter[];
87
+ body: Statement[];
88
+
89
+ isFunctionDeclaration: true;
90
+ }
91
+
92
+ export class Expression {
93
+ constructor(expression: string);
94
+
95
+ expression: string;
96
+
97
+ isExpression: true;
98
+ }
99
+
100
+ export class Ternary {
101
+ constructor(cond: Statement, left: Statement, right: Statement);
102
+
103
+ cond: Statement;
104
+ left: Statement;
105
+ right: Statement;
106
+
107
+ isTernary: true;
108
+ }
109
+
110
+ export class Operator {
111
+ constructor(type: string, left: Statement, right: Statement);
112
+
113
+ type: string;
114
+ left: Statement;
115
+ right: Statement;
116
+
117
+ isOperator: true;
118
+ }
119
+
120
+ export class Unary {
121
+ constructor(type: string, expression: Statement, after?: boolean);
122
+
123
+ type: string;
124
+ expression: Statement;
125
+ after: boolean;
126
+
127
+ isUnary: true;
128
+ }
129
+
130
+ export class Number {
131
+ constructor(value: string, type?: string);
5
132
 
133
+ type: string;
134
+ value: string;
135
+
136
+ isNumber: true;
137
+ }
138
+
139
+ export class String {
140
+ constructor(value: string);
141
+
142
+ value: string;
143
+
144
+ isString: true;
145
+ }
146
+
147
+ export class Conditional {
148
+ constructor(cond?: Conditional | null);
149
+
150
+ cond: Conditional | null;
151
+
152
+ body: Statement[];
153
+ elseConditional: Conditional | null;
154
+
155
+ isConditional: true;
156
+ }
157
+
158
+ export class FunctionCall {
159
+ constructor(name: string, params?: Statement[]);
160
+
161
+ name: string;
162
+ params: Statement[];
163
+
164
+ isFunctionCall: true;
165
+ }
166
+
167
+ export class Return {
168
+ constructor(value: Statement);
169
+
170
+ value: Statement;
171
+
172
+ isReturn: true;
173
+ }
174
+
175
+ export class Discard {
6
176
  constructor();
177
+
178
+ isDiscard: true;
179
+ }
180
+
181
+ export class Accessor {
182
+ constructor(property: string);
183
+
184
+ property: string;
185
+
186
+ isAccessor: true;
187
+ }
188
+
189
+ export class StaticElement {
190
+ constructor(value: Statement);
191
+
192
+ value: Statement;
193
+
194
+ isStaticElement: true;
195
+ }
196
+
197
+ export class DynamicElement {
198
+ constructor(value: Statement);
199
+
200
+ value: Statement;
201
+
202
+ isDynamicElement: true;
203
+ }
204
+
205
+ export class AccessorElements {
206
+ constructor(object: FunctionCall | Accessor, elements?: (StaticElement | DynamicElement)[]);
207
+
208
+ object: FunctionCall | Accessor;
209
+ elements: (StaticElement | DynamicElement)[];
210
+
211
+ isAccessorElements: true;
212
+ }
213
+
214
+ export class For {
215
+ constructor(initialization: Statement, condition: Statement, afterthought: Statement);
216
+
217
+ initialization: Statement;
218
+ condition: Statement;
219
+ afterthought: Statement;
220
+
221
+ body: Statement[];
222
+
223
+ isFor: true;
7
224
  }
@@ -1,7 +1,41 @@
1
- import { Program } from "./AST.js";
1
+ import {
2
+ Conditional,
3
+ Expression,
4
+ For,
5
+ FunctionDeclaration,
6
+ Program,
7
+ Statement,
8
+ Ternary,
9
+ Uniform,
10
+ VariableDeclaration,
11
+ Varying,
12
+ } from "./AST.js";
2
13
 
3
14
  export default class TSLEncoder {
4
15
  constructor();
5
16
 
17
+ tab: string;
18
+ imports: Set<string>;
19
+ global: Set<string>;
20
+ overloadings: Map<string, string>;
21
+ iife: boolean;
22
+ uniqueNames: boolean;
23
+ reference: boolean;
24
+
25
+ addImport(name: string): void;
26
+ emitUniform(node: Uniform): string;
27
+ emitExpression(node: Expression): string;
28
+ emitBody(body: Statement[]): string;
29
+ emitTernary(node: Ternary): string;
30
+ emitConditional(node: Conditional): string;
31
+ emitLoop(node: For): string;
32
+ emitFor(node: For): string;
33
+ emitForWhile(node: For): string;
34
+ emitVariables(node: VariableDeclaration, isRoot?: boolean): string;
35
+ emitVarying(node: Varying): string;
36
+ emitOverloadingFunction(nodes: FunctionDeclaration[]): string;
37
+ emitFunction(node: FunctionDeclaration): string;
38
+ setLastStatement(statement: Statement | null): void;
39
+ emitExtraLine(statement: Statement): string;
6
40
  emit(ast: Program): string;
7
41
  }
@@ -1,5 +1,7 @@
1
- import { WebGLRenderer } from "three";
1
+ export interface VRButtonRenderer {
2
+ xr: { setSession: (value: XRSession) => Promise<void> };
3
+ }
2
4
 
3
5
  export class VRButton {
4
- static createButton(renderer: WebGLRenderer, sessionInit?: XRSessionInit): HTMLElement;
6
+ static createButton(renderer: VRButtonRenderer, sessionInit?: XRSessionInit): HTMLElement;
5
7
  }
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.174.0",
3
+ "version": "0.175.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -48,6 +48,6 @@
48
48
  "meshoptimizer": "~0.18.1"
49
49
  },
50
50
  "peerDependencies": {},
51
- "typesPublisherContentHash": "42b773a4ca2b467bb5f631194fbba7e91c3510c11d419d1c442487b3e4c90b2e",
51
+ "typesPublisherContentHash": "4f8410c1c95a3d20772bbb010426c784f9e9d9f20a8e4ab737d05ff2918553d6",
52
52
  "typeScriptVersion": "5.0"
53
53
  }
three/src/Three.TSL.d.ts CHANGED
@@ -116,6 +116,7 @@ export const color: typeof TSL.color;
116
116
  export const colorSpaceToWorking: typeof TSL.colorSpaceToWorking;
117
117
  export const colorToDirection: typeof TSL.colorToDirection;
118
118
  export const compute: typeof TSL.compute;
119
+ export const computeSkinning: typeof TSL.computeSkinning;
119
120
  export const cond: typeof TSL.cond;
120
121
  export const Const: typeof TSL.Const;
121
122
  export const context: typeof TSL.context;
@@ -128,6 +129,7 @@ export const cubeTexture: typeof TSL.cubeTexture;
128
129
  export const dFdx: typeof TSL.dFdx;
129
130
  export const dFdy: typeof TSL.dFdy;
130
131
  export const dashSize: typeof TSL.dashSize;
132
+ export const debug: typeof TSL.debug;
131
133
  export const defaultBuildStages: typeof TSL.defaultBuildStages;
132
134
  export const defaultShaderStages: typeof TSL.defaultShaderStages;
133
135
  export const defined: typeof TSL.defined;
@@ -407,6 +409,7 @@ export const rtt: typeof TSL.rtt;
407
409
  export const sRGBTransferEOTF: typeof TSL.sRGBTransferEOTF;
408
410
  export const sRGBTransferOETF: typeof TSL.sRGBTransferOETF;
409
411
  export const sampler: typeof TSL.sampler;
412
+ export const samplerComparison: typeof TSL.samplerComparison;
410
413
  export const saturate: typeof TSL.saturate;
411
414
  export const saturation: typeof TSL.saturation;
412
415
  export const screen: typeof TSL.screen;
@@ -432,7 +435,6 @@ export const sign: typeof TSL.sign;
432
435
  export const sin: typeof TSL.sin;
433
436
  export const sinc: typeof TSL.sinc;
434
437
  export const skinning: typeof TSL.skinning;
435
- export const skinningReference: typeof TSL.skinningReference;
436
438
  export const smoothstep: typeof TSL.smoothstep;
437
439
  export const smoothstepElement: typeof TSL.smoothstepElement;
438
440
  export const specularColor: typeof TSL.specularColor;