@types/three 0.158.3 → 0.159.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 (122) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +2 -1
  3. three/examples/jsm/cameras/CinematicCamera.d.ts +1 -1
  4. three/examples/jsm/helpers/TextureHelper.d.ts +10 -0
  5. three/examples/jsm/lines/LineMaterial.d.ts +2 -2
  6. three/examples/jsm/loaders/ColladaLoader.d.ts +1 -3
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
  8. three/examples/jsm/loaders/SVGLoader.d.ts +1 -5
  9. three/examples/jsm/math/Octree.d.ts +7 -3
  10. three/examples/jsm/misc/ProgressiveLightMap.d.ts +1 -1
  11. three/examples/jsm/nodes/core/constants.d.ts +1 -3
  12. three/examples/jsm/postprocessing/HBAOPass.d.ts +106 -0
  13. three/examples/jsm/renderers/common/Info.d.ts +7 -2
  14. three/examples/jsm/renderers/common/Renderer.d.ts +2 -2
  15. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +1 -0
  16. three/examples/jsm/shaders/HBAOShader.d.ts +44 -0
  17. three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +28 -0
  18. three/examples/jsm/utils/SortUtils.d.ts +7 -0
  19. three/package.json +3 -3
  20. three/src/Three.d.ts +1 -0
  21. three/src/animation/AnimationClip.d.ts +2 -2
  22. three/src/animation/AnimationMixer.d.ts +1 -1
  23. three/src/animation/KeyframeTrack.d.ts +3 -3
  24. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +1 -1
  25. three/src/animation/tracks/ColorKeyframeTrack.d.ts +1 -1
  26. three/src/animation/tracks/NumberKeyframeTrack.d.ts +1 -1
  27. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +1 -1
  28. three/src/animation/tracks/StringKeyframeTrack.d.ts +1 -1
  29. three/src/animation/tracks/VectorKeyframeTrack.d.ts +1 -1
  30. three/src/audio/Audio.d.ts +1 -1
  31. three/src/audio/AudioListener.d.ts +1 -1
  32. three/src/core/BufferAttribute.d.ts +27 -0
  33. three/src/core/BufferGeometry.d.ts +1 -1
  34. three/src/core/InterleavedBuffer.d.ts +27 -0
  35. three/src/core/InterleavedBufferAttribute.d.ts +2 -2
  36. three/src/core/Object3D.d.ts +48 -14
  37. three/src/core/Raycaster.d.ts +1 -0
  38. three/src/extras/core/Curve.d.ts +2 -2
  39. three/src/extras/core/Path.d.ts +1 -1
  40. three/src/extras/core/Shape.d.ts +1 -1
  41. three/src/extras/core/ShapePath.d.ts +1 -1
  42. three/src/extras/curves/CatmullRomCurve3.d.ts +2 -2
  43. three/src/extras/curves/CubicBezierCurve.d.ts +2 -2
  44. three/src/extras/curves/CubicBezierCurve3.d.ts +2 -2
  45. three/src/extras/curves/EllipseCurve.d.ts +1 -1
  46. three/src/extras/curves/LineCurve.d.ts +2 -2
  47. three/src/extras/curves/LineCurve3.d.ts +2 -2
  48. three/src/extras/curves/QuadraticBezierCurve.d.ts +2 -2
  49. three/src/extras/curves/QuadraticBezierCurve3.d.ts +2 -2
  50. three/src/extras/curves/SplineCurve.d.ts +2 -2
  51. three/src/geometries/ExtrudeGeometry.d.ts +5 -5
  52. three/src/geometries/LatheGeometry.d.ts +2 -2
  53. three/src/geometries/PlaneGeometry.d.ts +1 -1
  54. three/src/geometries/PolyhedronGeometry.d.ts +1 -1
  55. three/src/geometries/RingGeometry.d.ts +1 -1
  56. three/src/geometries/ShapeGeometry.d.ts +2 -2
  57. three/src/geometries/SphereGeometry.d.ts +1 -1
  58. three/src/geometries/TorusGeometry.d.ts +1 -1
  59. three/src/geometries/TorusKnotGeometry.d.ts +1 -1
  60. three/src/geometries/TubeGeometry.d.ts +3 -3
  61. three/src/geometries/WireframeGeometry.d.ts +1 -1
  62. three/src/helpers/ArrowHelper.d.ts +4 -4
  63. three/src/helpers/AxesHelper.d.ts +1 -1
  64. three/src/helpers/Box3Helper.d.ts +3 -3
  65. three/src/helpers/CameraHelper.d.ts +2 -2
  66. three/src/helpers/DirectionalLightHelper.d.ts +6 -4
  67. three/src/helpers/GridHelper.d.ts +1 -1
  68. three/src/helpers/HemisphereLightHelper.d.ts +4 -4
  69. three/src/helpers/PlaneHelper.d.ts +2 -2
  70. three/src/helpers/PointLightHelper.d.ts +3 -3
  71. three/src/helpers/SkeletonHelper.d.ts +4 -4
  72. three/src/helpers/SpotLightHelper.d.ts +3 -3
  73. three/src/lights/DirectionalLight.d.ts +1 -1
  74. three/src/lights/DirectionalLightShadow.d.ts +1 -1
  75. three/src/lights/HemisphereLight.d.ts +1 -1
  76. three/src/lights/LightProbe.d.ts +1 -1
  77. three/src/lights/LightShadow.d.ts +5 -5
  78. three/src/lights/PointLightShadow.d.ts +1 -1
  79. three/src/lights/SpotLight.d.ts +1 -1
  80. three/src/lights/SpotLightShadow.d.ts +1 -1
  81. three/src/materials/Material.d.ts +2 -2
  82. three/src/materials/MeshBasicMaterial.d.ts +2 -2
  83. three/src/materials/MeshDepthMaterial.d.ts +1 -1
  84. three/src/materials/MeshDistanceMaterial.d.ts +2 -2
  85. three/src/materials/MeshLambertMaterial.d.ts +2 -2
  86. three/src/materials/MeshMatcapMaterial.d.ts +3 -3
  87. three/src/materials/MeshNormalMaterial.d.ts +2 -2
  88. three/src/materials/MeshPhongMaterial.d.ts +3 -3
  89. three/src/materials/MeshStandardMaterial.d.ts +3 -3
  90. three/src/materials/MeshToonMaterial.d.ts +3 -3
  91. three/src/materials/PointsMaterial.d.ts +2 -2
  92. three/src/materials/ShadowMaterial.d.ts +1 -1
  93. three/src/materials/SpriteMaterial.d.ts +2 -2
  94. three/src/math/Box3.d.ts +2 -2
  95. three/src/math/Frustum.d.ts +2 -2
  96. three/src/math/Vector2.d.ts +1 -1
  97. three/src/math/Vector4.d.ts +1 -1
  98. three/src/objects/BatchedMesh.d.ts +169 -0
  99. three/src/objects/Bone.d.ts +1 -1
  100. three/src/objects/LOD.d.ts +2 -4
  101. three/src/objects/Line.d.ts +2 -4
  102. three/src/objects/LineLoop.d.ts +1 -1
  103. three/src/objects/LineSegments.d.ts +1 -1
  104. three/src/objects/Skeleton.d.ts +2 -8
  105. three/src/renderers/WebGL3DRenderTarget.d.ts +7 -5
  106. three/src/renderers/WebGLArrayRenderTarget.d.ts +7 -5
  107. three/src/renderers/WebGLCubeRenderTarget.d.ts +2 -2
  108. three/src/renderers/WebGLRenderTarget.d.ts +1 -1
  109. three/src/renderers/shaders/ShaderChunk.d.ts +1 -0
  110. three/src/renderers/webgl/WebGLAttributes.d.ts +1 -0
  111. three/src/renderers/webgl/WebGLBindingStates.d.ts +4 -4
  112. three/src/renderers/webgl/WebGLBufferRenderer.d.ts +4 -3
  113. three/src/renderers/webgl/WebGLClipping.d.ts +2 -2
  114. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +5 -4
  115. three/src/renderers/webgl/WebGLPrograms.d.ts +3 -3
  116. three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -5
  117. three/src/renderers/webgl/WebGLShadowMap.d.ts +2 -2
  118. three/src/scenes/Fog.d.ts +1 -1
  119. three/src/scenes/FogExp2.d.ts +1 -1
  120. three/src/textures/Texture.d.ts +1 -1
  121. three/examples/jsm/objects/BatchedMesh.d.ts +0 -57
  122. three/examples/jsm/renderers/common/Animation.d.ts +0 -16
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: Mon, 20 Nov 2023 23:36:24 GMT
11
+ * Last updated: Thu, 30 Nov 2023 20:07:36 GMT
12
12
  * Dependencies: [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
13
13
 
14
14
  # Credits
@@ -60,6 +60,7 @@ export * from './helpers/LightProbeHelper.js';
60
60
  export * from './helpers/OctreeHelper.js';
61
61
  export * from './helpers/PositionalAudioHelper.js';
62
62
  export * from './helpers/RectAreaLightHelper.js';
63
+ export * from './helpers/TextureHelper.js';
63
64
  export * from './helpers/VertexNormalsHelper.js';
64
65
  export * from './helpers/VertexTangentsHelper.js';
65
66
  export * from './helpers/ViewHelper.js';
@@ -159,7 +160,6 @@ export * from './modifiers/EdgeSplitModifier.js';
159
160
  export * from './modifiers/SimplifyModifier.js';
160
161
  export * from './modifiers/TessellateModifier.js';
161
162
 
162
- export * from './objects/BatchedMesh.js';
163
163
  export * from './objects/GroundProjectedSkybox.js';
164
164
  export * from './objects/Lensflare.js';
165
165
  export * from './objects/MarchingCubes.js';
@@ -272,6 +272,7 @@ export * from './utils/PackedPhongMaterial.js';
272
272
  export * as SceneUtils from './utils/SceneUtils.js';
273
273
  export * from './utils/ShadowMapViewer.js';
274
274
  export * as SkeletonUtils from './utils/SkeletonUtils.js';
275
+ export * as SortUtils from './utils/SortUtils.js';
275
276
  export * from './utils/TextureUtils.js';
276
277
  export * from './utils/UVsDebug.js';
277
278
  export * from './utils/WorkerPool.js';
@@ -7,7 +7,7 @@ import {
7
7
  WebGLRenderTarget,
8
8
  } from '../../../src/Three.js';
9
9
 
10
- import { BokehShaderUniforms } from './../shaders/BokehShader2.js';
10
+ import { BokehShaderUniforms } from '../shaders/BokehShader2.js';
11
11
 
12
12
  export class CinematicCamera extends PerspectiveCamera {
13
13
  constructor(fov: number, aspect: number, near: number, far: number);
@@ -0,0 +1,10 @@
1
+ import { Mesh, Texture } from '../../../src/Three.js';
2
+
3
+ export class TextureHelper extends Mesh {
4
+ texture: Texture;
5
+ type: 'TextureHelper';
6
+
7
+ constructor(texture: Texture, width?: number, height?: number, depth?: number);
8
+
9
+ dispose(): void;
10
+ }
@@ -1,8 +1,8 @@
1
- import { Color, MaterialParameters, ShaderMaterial, Vector2 } from '../../../src/Three.js';
1
+ import { Color, ColorRepresentation, MaterialParameters, ShaderMaterial, Vector2 } from '../../../src/Three.js';
2
2
 
3
3
  export interface LineMaterialParameters extends MaterialParameters {
4
4
  alphaToCoverage?: boolean | undefined;
5
- color?: number | undefined;
5
+ color?: ColorRepresentation | undefined;
6
6
  dashed?: boolean | undefined;
7
7
  dashScale?: number | undefined;
8
8
  dashSize?: number | undefined;
@@ -1,4 +1,4 @@
1
- import { Loader, LoadingManager, Scene } from '../../../src/Three.js';
1
+ import { Loader, Scene } from '../../../src/Three.js';
2
2
 
3
3
  export interface Collada {
4
4
  kinematics: object;
@@ -7,7 +7,5 @@ export interface Collada {
7
7
  }
8
8
 
9
9
  export class ColladaLoader extends Loader<Collada> {
10
- constructor(manager?: LoadingManager);
11
-
12
10
  parse(text: string, path: string): Collada;
13
11
  }
@@ -36,7 +36,7 @@ export interface GLTF {
36
36
  extras?: any;
37
37
  };
38
38
  parser: GLTFParser;
39
- userData: any;
39
+ userData: Record<string, any>;
40
40
  }
41
41
 
42
42
  export class GLTFLoader extends Loader<GLTF> {
@@ -1,11 +1,7 @@
1
1
  import { Loader, LoadingManager, ShapePath, BufferGeometry, Vector3, Shape, Vector2 } from '../../../src/Three.js';
2
2
 
3
3
  export interface SVGResultPaths extends ShapePath {
4
- userData?:
5
- | {
6
- [key: string]: any;
7
- }
8
- | undefined;
4
+ userData?: Record<string, any> | undefined;
9
5
  }
10
6
 
11
7
  export interface SVGResult {
@@ -3,10 +3,13 @@ import { Triangle, Box3, Ray, Sphere, Object3D } from '../../../src/Three.js';
3
3
  import { Capsule } from './Capsule.js';
4
4
 
5
5
  export class Octree {
6
- constructor(box?: Box3);
7
- triangles: Triangle[];
8
- box: Box3;
6
+ box: Box3 | null | undefined;
7
+ bounds: Box3;
8
+
9
9
  subTrees: Octree[];
10
+ triangles: Triangle[];
11
+
12
+ constructor(box?: Box3 | null);
10
13
 
11
14
  addTriangle(triangle: Triangle): this;
12
15
  calcBox(): this;
@@ -21,4 +24,5 @@ export class Octree {
21
24
  capsuleIntersect(capsule: Capsule): any;
22
25
  rayIntersect(ray: Ray): any;
23
26
  fromGraphNode(group: Object3D): this;
27
+ clear(): this;
24
28
  }
@@ -11,7 +11,7 @@ import {
11
11
  WebGLRenderer,
12
12
  Scene,
13
13
  WebGLRenderTarget,
14
- } from './../../../src/Three.js';
14
+ } from '../../../src/Three.js';
15
15
 
16
16
  export interface UVBoxes {
17
17
  w: number;
@@ -54,9 +54,7 @@ export type NodeTypeOption =
54
54
  export type SwizzleOption = string;
55
55
 
56
56
  /** Should be the same type as Object3D.userData */
57
- export interface NodeUserData {
58
- [key: string]: any;
59
- }
57
+ export type NodeUserData = Record<string, any>;
60
58
 
61
59
  /** generic key value type,curretly used by nodes */
62
60
  export interface AnyObject {
@@ -0,0 +1,106 @@
1
+ import {
2
+ Camera,
3
+ Color,
4
+ ColorRepresentation,
5
+ DataTexture,
6
+ DepthTexture,
7
+ MeshNormalMaterial,
8
+ Scene,
9
+ ShaderMaterial,
10
+ Texture,
11
+ WebGLRenderer,
12
+ WebGLRenderTarget,
13
+ } from '../../../src/Three.js';
14
+
15
+ import { FullScreenQuad, Pass } from './Pass.js';
16
+
17
+ export class HBAOPass extends Pass {
18
+ width: number;
19
+ height: number;
20
+ clear: boolean;
21
+ camera: Camera;
22
+ scene: Scene;
23
+ output: number;
24
+
25
+ rings: number;
26
+ samples: number;
27
+
28
+ noiseTexture: DataTexture;
29
+
30
+ hbaoRenderTarget: WebGLRenderTarget;
31
+ pdRenderTarget: WebGLRenderTarget;
32
+
33
+ hbaoMaterial: ShaderMaterial;
34
+
35
+ normalMaterial: MeshNormalMaterial;
36
+
37
+ pdMaterial: ShaderMaterial;
38
+
39
+ depthRenderMaterial: ShaderMaterial;
40
+
41
+ copyMaterial: ShaderMaterial;
42
+
43
+ fsQuad: FullScreenQuad;
44
+
45
+ originalClearColor: Color;
46
+
47
+ depthTexture: DepthTexture;
48
+ normalTexture: Texture;
49
+
50
+ constructor(
51
+ scene: Scene,
52
+ camera: Camera,
53
+ width?: number | undefined,
54
+ height?: number | undefined,
55
+ parameters?: { depthTexture?: DepthTexture | undefined; normalTexture?: Texture | undefined } | undefined,
56
+ );
57
+
58
+ setTextures(depthTexture?: DepthTexture | undefined, normalTexture?: Texture | undefined): void;
59
+
60
+ updateHbaoMaterial(parameters: {
61
+ radius?: number | undefined;
62
+ distanceExponent?: number | undefined;
63
+ bias?: number | undefined;
64
+ samples?: number | undefined;
65
+ }): void;
66
+
67
+ updatePdMaterial(parameters: {
68
+ lumaPhi?: number | undefined;
69
+ depthPhi?: number | undefined;
70
+ normalPhi?: number | undefined;
71
+ radius?: number | undefined;
72
+ rings?: number | undefined;
73
+ samples?: number | undefined;
74
+ }): void;
75
+
76
+ renderPass(
77
+ renderer: WebGLRenderer,
78
+ passMaterial: ShaderMaterial,
79
+ renderTarget: WebGLRenderTarget | null,
80
+ clearColor?: ColorRepresentation | undefined,
81
+ clearAlpha?: number | undefined,
82
+ ): void;
83
+
84
+ renderOverride(
85
+ renderer: WebGLRenderer,
86
+ overrideMaterial: MeshNormalMaterial,
87
+ renderTarget: WebGLRenderTarget | null,
88
+ clearColor?: ColorRepresentation | undefined,
89
+ clearAlpha?: number | undefined,
90
+ ): void;
91
+
92
+ overrideVisibility(): void;
93
+
94
+ restoreVisibility(): void;
95
+
96
+ generateNoise(size?: number): DataTexture;
97
+
98
+ static OUTPUT: {
99
+ Default: 0;
100
+ Diffuse: 1;
101
+ Depth: 2;
102
+ Normal: 3;
103
+ HBAO: 4;
104
+ Denoise: 5;
105
+ };
106
+ }
@@ -1,9 +1,14 @@
1
1
  import { Object3D } from '../../../../src/Three.js';
2
2
 
3
3
  export default class Info {
4
- autoRest: boolean;
4
+ autoReset: boolean;
5
5
 
6
- render: { frame: number; drawCalls: number; triangles: number; points: number; lines: number };
6
+ frame: number;
7
+ calls: number;
8
+
9
+ render: { calls: number; drawCalls: number; triangles: number; points: number; lines: number };
10
+
11
+ compute: { calls: number };
7
12
 
8
13
  memory: { geometries: number; textures: number };
9
14
 
@@ -26,7 +26,7 @@ export default class Renderer {
26
26
 
27
27
  info: Info;
28
28
 
29
- constructor(backend: Backend);
29
+ constructor(backend: Backend, parameters?: { logarithmicDepthBuffer?: boolean | undefined });
30
30
 
31
31
  init(): Promise<void>;
32
32
 
@@ -34,7 +34,7 @@ export default class Renderer {
34
34
 
35
35
  render(scene: Scene, camera: Camera): Promise<void>;
36
36
 
37
- setAnimationLoop(callback: ((time: DOMHighResTimeStamp) => void) | null): void;
37
+ setAnimationLoop(callback: ((time: DOMHighResTimeStamp) => void) | null): Promise<void>;
38
38
 
39
39
  setPixelRatio(value?: number): void;
40
40
 
@@ -5,5 +5,6 @@ export default class WebGPURenderer extends Renderer {
5
5
  canvas?: HTMLCanvasElement | undefined;
6
6
  antialias?: boolean | undefined;
7
7
  sampleCount?: number | undefined;
8
+ logarithmicDepthBuffer?: boolean | undefined;
8
9
  });
9
10
  }
@@ -0,0 +1,44 @@
1
+ import { IUniform, Matrix4, Vector2 } from '../../../src/Three.js';
2
+
3
+ export const HBAOShader: {
4
+ name: string;
5
+ defines: {
6
+ PERSPECTIVE_CAMERA: number;
7
+ SAMPLES: number;
8
+ SAMPLE_VECTORS: string;
9
+ NORMAL_VECTOR_TYPE: number;
10
+ DEPTH_VALUE_SOURCE: number;
11
+ SAMPLING_FROM_NOISE: number;
12
+ };
13
+ uniforms: {
14
+ tNormal: IUniform;
15
+ tDepth: IUniform;
16
+ tNoise: IUniform;
17
+ resolution: IUniform<Vector2>;
18
+ cameraNear: IUniform;
19
+ cameraFar: IUniform;
20
+ cameraProjectionMatrix: IUniform<Matrix4>;
21
+ cameraProjectionMatrixInverse: IUniform<Matrix4>;
22
+ radius: IUniform<number>;
23
+ distanceExponent: IUniform<number>;
24
+ bias: IUniform<number>;
25
+ };
26
+ vertexShader: string;
27
+ fragmentShader: string;
28
+ };
29
+
30
+ export const HBAODepthShader: {
31
+ name: string;
32
+ defines: {
33
+ PERSPECTIVE_CAMERA: number;
34
+ };
35
+ uniforms: {
36
+ tDepth: IUniform;
37
+ cameraNear: IUniform;
38
+ cameraFar: IUniform;
39
+ };
40
+ vertexShader: string;
41
+ fragmentShader: string;
42
+ };
43
+
44
+ export function generateHaboSampleKernelInitializer(samples: number): string;
@@ -0,0 +1,28 @@
1
+ import { IUniform, Matrix4, Vector2 } from '../../../src/Three.js';
2
+
3
+ export const PoissonDenoiseShader: {
4
+ name: string;
5
+ defines: {
6
+ SAMPLES: number;
7
+ SAMPLE_VECTORS: string;
8
+ NORMAL_VECTOR_TYPE: number;
9
+ DEPTH_VALUE_SOURCE: number;
10
+ };
11
+ uniforms: {
12
+ tDiffuse: IUniform;
13
+ tNormal: IUniform;
14
+ tDepth: IUniform;
15
+ tNoise: IUniform;
16
+ resolution: IUniform<Vector2>;
17
+ cameraProjectionMatrixInverse: IUniform<Matrix4>;
18
+ lumaPhi: IUniform<number>;
19
+ depthPhi: IUniform<number>;
20
+ normalPhi: IUniform<number>;
21
+ radius: IUniform<number>;
22
+ index: IUniform<number>;
23
+ };
24
+ vertexShader: string;
25
+ fragmentShader: string;
26
+ };
27
+
28
+ export function generatePdSamplePointInitializer(samples: number, rings: number): string;
@@ -0,0 +1,7 @@
1
+ export interface RadixSortOptions<T> {
2
+ aux?: T[] | undefined;
3
+ get?: ((el: T) => number) | undefined;
4
+ reversed?: boolean | undefined;
5
+ }
6
+
7
+ export const radixSort: <T = number>(arr: T[], opt?: RadixSortOptions<T>) => void;
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.158.3",
3
+ "version": "0.159.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -44,6 +44,6 @@
44
44
  "fflate": "~0.6.10",
45
45
  "meshoptimizer": "~0.18.1"
46
46
  },
47
- "typesPublisherContentHash": "63e0c6a37dc1c160eecdbe61741d097ff25ba5c1e0bd8a134ae21d23bc71b38f",
48
- "typeScriptVersion": "4.5"
47
+ "typesPublisherContentHash": "00146f19c0acfa1923520aa89574fd3c011b0b97251b16d57b2bc5999534c2c9",
48
+ "typeScriptVersion": "4.6"
49
49
  }
three/src/Three.d.ts CHANGED
@@ -165,6 +165,7 @@ export { MathUtils };
165
165
  export * from './objects/Sprite.js';
166
166
  export * from './objects/LOD.js';
167
167
  export * from './objects/InstancedMesh.js';
168
+ export * from './objects/BatchedMesh.js';
168
169
  export * from './objects/SkinnedMesh.js';
169
170
  export * from './objects/Skeleton.js';
170
171
  export * from './objects/Bone.js';
@@ -1,6 +1,6 @@
1
1
  import { KeyframeTrack } from './KeyframeTrack.js';
2
- import { Vector3 } from './../math/Vector3.js';
3
- import { Bone } from './../objects/Bone.js';
2
+ import { Vector3 } from '../math/Vector3.js';
3
+ import { Bone } from '../objects/Bone.js';
4
4
  import { AnimationBlendMode } from '../constants.js';
5
5
 
6
6
  export interface MorphTarget {
@@ -1,7 +1,7 @@
1
1
  import { AnimationClip } from './AnimationClip.js';
2
2
  import { AnimationAction } from './AnimationAction.js';
3
3
  import { AnimationBlendMode } from '../constants.js';
4
- import { EventDispatcher } from './../core/EventDispatcher.js';
4
+ import { EventDispatcher } from '../core/EventDispatcher.js';
5
5
  import { Object3D } from '../core/Object3D.js';
6
6
  import { AnimationObjectGroup } from './AnimationObjectGroup.js';
7
7
 
@@ -1,6 +1,6 @@
1
- import { DiscreteInterpolant } from './../math/interpolants/DiscreteInterpolant.js';
2
- import { LinearInterpolant } from './../math/interpolants/LinearInterpolant.js';
3
- import { CubicInterpolant } from './../math/interpolants/CubicInterpolant.js';
1
+ import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js';
2
+ import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js';
3
+ import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js';
4
4
  import { Interpolant } from '../math/Interpolant.js';
5
5
  import { InterpolationModes } from '../constants.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
 
3
3
  export class BooleanKeyframeTrack extends KeyframeTrack {
4
4
  constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class ColorKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class NumberKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class QuaternionKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class StringKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class VectorKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { Object3D } from './../core/Object3D.js';
1
+ import { Object3D } from '../core/Object3D.js';
2
2
  import { AudioListener } from './AudioListener.js';
3
3
  import { AudioContext } from './AudioContext.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Object3D } from './../core/Object3D.js';
1
+ import { Object3D } from '../core/Object3D.js';
2
2
  import { AudioContext } from './AudioContext.js';
3
3
 
4
4
  /**
@@ -88,6 +88,7 @@ export class BufferAttribute {
88
88
  /**
89
89
  * This can be used to only update some components of stored vectors (for example, just the component related to color).
90
90
  * @defaultValue `{ offset: number = 0; count: number = -1 }`
91
+ * @deprecated Will be removed in r169. Use "addUpdateRange()" instead.
91
92
  */
92
93
  updateRange: {
93
94
  /**
@@ -99,6 +100,21 @@ export class BufferAttribute {
99
100
  count: number;
100
101
  };
101
102
 
103
+ /**
104
+ * This can be used to only update some components of stored vectors (for example, just the component related to
105
+ * color). Use the {@link .addUpdateRange} function to add ranges to this array.
106
+ */
107
+ updateRanges: Array<{
108
+ /**
109
+ * Position at which to start update.
110
+ */
111
+ start: number;
112
+ /**
113
+ * The number of components to update.
114
+ */
115
+ count: number;
116
+ }>;
117
+
102
118
  /**
103
119
  * A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true.
104
120
  * @remarks Expects a `Integer`
@@ -159,6 +175,17 @@ export class BufferAttribute {
159
175
  */
160
176
  setUsage(usage: Usage): this;
161
177
 
178
+ /**
179
+ * Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the
180
+ * {@link .updateRanges} array.
181
+ */
182
+ addUpdateRange(start: number, count: number): void;
183
+
184
+ /**
185
+ * Clears the {@link .updateRanges} array.
186
+ */
187
+ clearUpdateRanges(): void;
188
+
162
189
  /**
163
190
  * @returns a copy of this {@link BufferAttribute}.
164
191
  */
@@ -188,7 +188,7 @@ export class BufferGeometry<
188
188
  * An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
189
189
  * @defaultValue `{}`
190
190
  */
191
- userData: { [key: string]: any };
191
+ userData: Record<string, any>;
192
192
 
193
193
  /**
194
194
  * Read-only flag to check if a given object is of type {@link BufferGeometry}.
@@ -43,6 +43,7 @@ export class InterleavedBuffer {
43
43
  /**
44
44
  * Object containing offset and count.
45
45
  * @defaultValue `{ offset: number = 0; count: number = -1 }`
46
+ * @deprecated Will be removed in r169. Use "addUpdateRange()" instead.
46
47
  */
47
48
  updateRange: {
48
49
  /** @defaultValue `0` */
@@ -51,6 +52,21 @@ export class InterleavedBuffer {
51
52
  count: number;
52
53
  };
53
54
 
55
+ /**
56
+ * This can be used to only update some components of stored data. Use the {@link .addUpdateRange} function to add
57
+ * ranges to this array.
58
+ */
59
+ updateRanges: Array<{
60
+ /**
61
+ * Position at which to start update.
62
+ */
63
+ start: number;
64
+ /**
65
+ * The number of components to update.
66
+ */
67
+ count: number;
68
+ }>;
69
+
54
70
  /**
55
71
  * A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true.
56
72
  * @remarks Expects a `Integer`
@@ -99,6 +115,17 @@ export class InterleavedBuffer {
99
115
  */
100
116
  setUsage(value: Usage): this;
101
117
 
118
+ /**
119
+ * Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the
120
+ * {@link .updateRanges} array.
121
+ */
122
+ addUpdateRange(start: number, count: number): void;
123
+
124
+ /**
125
+ * Clears the {@link .updateRanges} array.
126
+ */
127
+ clearUpdateRanges(): void;
128
+
102
129
  /**
103
130
  * Copies another {@link InterleavedBuffer} to this {@link InterleavedBuffer} instance.
104
131
  * @param source
@@ -1,7 +1,7 @@
1
1
  import { BufferAttribute, TypedArray } from './BufferAttribute.js';
2
2
  import { InterleavedBuffer } from './InterleavedBuffer.js';
3
- import { Matrix4 } from './../math/Matrix4.js';
4
- import { Matrix } from './../math/Matrix3.js';
3
+ import { Matrix4 } from '../math/Matrix4.js';
4
+ import { Matrix } from '../math/Matrix3.js';
5
5
 
6
6
  /**
7
7
  * @see {@link https://threejs.org/docs/index.html#api/en/core/InterleavedBufferAttribute | Official Documentation}