@types/three 0.148.1 → 0.150.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 (62) hide show
  1. three/README.md +2 -2
  2. three/build/three.d.cts +2 -0
  3. three/build/three.d.ts +2 -0
  4. three/build/three.module.d.ts +2 -0
  5. three/examples/jsm/controls/OrbitControls.d.ts +8 -3
  6. three/examples/jsm/controls/TrackballControls.d.ts +2 -2
  7. three/examples/jsm/controls/TransformControls.d.ts +4 -4
  8. three/examples/jsm/helpers/OctreeHelper.d.ts +1 -1
  9. three/examples/jsm/helpers/ViewHelper.d.ts +16 -0
  10. three/examples/jsm/libs/fflate.module.d.ts +1 -0
  11. three/examples/jsm/libs/lil-gui.module.min.d.ts +1 -0
  12. three/examples/jsm/libs/stats.module.d.ts +2 -23
  13. three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +1 -1
  14. three/examples/jsm/loaders/IFCLoader.d.ts +1 -0
  15. three/examples/jsm/loaders/USDZLoader.d.ts +1 -0
  16. three/examples/jsm/loaders/VOXLoader.d.ts +1 -1
  17. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +1 -0
  18. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +3 -4
  19. three/examples/jsm/objects/MarchingCubes.d.ts +1 -0
  20. three/examples/jsm/shaders/VelocityShader.d.ts +2 -2
  21. three/index.d.ts +1 -1
  22. three/package.json +19 -4
  23. three/src/Three.d.ts +1 -5
  24. three/src/constants.d.ts +395 -253
  25. three/src/core/BufferAttribute.d.ts +456 -85
  26. three/src/core/BufferGeometry.d.ts +241 -70
  27. three/src/core/Clock.d.ts +28 -20
  28. three/src/core/EventDispatcher.d.ts +20 -4
  29. three/src/core/GLBufferAttribute.d.ts +105 -7
  30. three/src/core/InstancedBufferAttribute.d.ts +13 -24
  31. three/src/core/InstancedBufferGeometry.d.ts +22 -4
  32. three/src/core/InstancedInterleavedBuffer.d.ts +10 -2
  33. three/src/core/InterleavedBuffer.d.ts +98 -14
  34. three/src/core/InterleavedBufferAttribute.d.ts +146 -7
  35. three/src/core/Layers.d.ts +61 -6
  36. three/src/core/Object3D.d.ts +252 -119
  37. three/src/core/Raycaster.d.ts +103 -27
  38. three/src/core/Uniform.d.ts +30 -13
  39. three/src/core/UniformsGroup.d.ts +10 -4
  40. three/src/extras/Earcut.d.ts +3 -4
  41. three/src/helpers/CameraHelper.d.ts +43 -0
  42. three/src/lights/DirectionalLight.d.ts +3 -1
  43. three/src/lights/HemisphereLight.d.ts +3 -1
  44. three/src/lights/SpotLight.d.ts +3 -1
  45. three/src/loaders/CubeTextureLoader.d.ts +1 -1
  46. three/src/loaders/Loader.d.ts +1 -2
  47. three/src/materials/Material.d.ts +9 -2
  48. three/src/materials/MeshPhysicalMaterial.d.ts +13 -1
  49. three/src/math/Color.d.ts +157 -3
  50. three/src/math/ColorManagement.d.ts +13 -7
  51. three/src/math/Euler.d.ts +2 -3
  52. three/src/objects/Mesh.d.ts +2 -2
  53. three/src/renderers/WebGLRenderer.d.ts +2 -2
  54. three/src/renderers/webgl/WebGLAttributes.d.ts +4 -3
  55. three/src/renderers/webgl/WebGLClipping.d.ts +3 -1
  56. three/src/renderers/webxr/WebXRManager.d.ts +2 -2
  57. three/src/textures/Data3DTexture.d.ts +2 -2
  58. three/src/utils.d.ts +5 -2
  59. three/examples/jsm/libs/fflate.module.min.d.ts +0 -1185
  60. three/src/renderers/WebGLMultisampleRenderTarget.d.ts +0 -6
  61. three/src/textures/DataTexture2DArray.d.ts +0 -6
  62. three/src/textures/DataTexture3D.d.ts +0 -6
@@ -1,4 +1,4 @@
1
- import { ColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
1
+ import { ColorSpace, DisplayP3ColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
2
2
  import { Color } from './Color';
3
3
 
4
4
  export function SRGBToLinear(c: number): number;
@@ -7,9 +7,9 @@ export function LinearToSRGB(c: number): number;
7
7
 
8
8
  export namespace ColorManagement {
9
9
  /**
10
- * @default true
10
+ * @default false
11
11
  */
12
- let legacyMode: boolean;
12
+ let enabled: boolean;
13
13
 
14
14
  /**
15
15
  * @default LinearSRGBColorSpace
@@ -18,11 +18,17 @@ export namespace ColorManagement {
18
18
 
19
19
  function convert(
20
20
  color: Color,
21
- sourceColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
22
- targetColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
21
+ sourceColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace | typeof DisplayP3ColorSpace,
22
+ targetColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace | typeof DisplayP3ColorSpace,
23
23
  ): Color;
24
24
 
25
- function fromWorkingColorSpace(color: Color, targetColorSpace: SRGBColorSpace | LinearSRGBColorSpace): Color;
25
+ function fromWorkingColorSpace(
26
+ color: Color,
27
+ targetColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace,
28
+ ): Color;
26
29
 
27
- function toWorkingColorSpace(color: Color, sourceColorSpace: SRGBColorSpace | LinearSRGBColorSpace): Color;
30
+ function toWorkingColorSpace(
31
+ color: Color,
32
+ sourceColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace,
33
+ ): Color;
28
34
  }
three/src/math/Euler.d.ts CHANGED
@@ -23,7 +23,7 @@ export class Euler {
23
23
  z: number;
24
24
 
25
25
  /**
26
- * @default THREE.Euler.DefaultOrder
26
+ * @default THREE.Euler.DEFAULT_ORDER
27
27
  */
28
28
  order: EulerOrder;
29
29
  readonly isEuler: true;
@@ -42,8 +42,7 @@ export class Euler {
42
42
  toArray(array?: Array<number | string | undefined>, offset?: number): Array<number | string | undefined>;
43
43
  _onChange(callback: () => void): this;
44
44
 
45
- static RotationOrders: EulerOrder[];
46
- static DefaultOrder: 'XYZ';
45
+ static DEFAULT_ORDER: 'XYZ';
47
46
 
48
47
  [Symbol.iterator](): Generator<string | number, void>;
49
48
  }
@@ -21,10 +21,10 @@ export class Mesh<
21
21
  updateMorphTargets(): void;
22
22
 
23
23
  /**
24
- * Get the current position of the indicated vertex in local space,
24
+ * Get the local-space position of the vertex at the given index,
25
25
  * taking into account the current animation state of both morph targets and skinning.
26
26
  */
27
- getVertexPosition(vert: number, target: Vector3): Vector3;
27
+ getVertexPosition(index: number, target: Vector3): Vector3;
28
28
 
29
29
  raycast(raycaster: Raycaster, intersects: Intersection[]): void;
30
30
  }
@@ -178,9 +178,9 @@ export class WebGLRenderer implements Renderer {
178
178
  outputEncoding: TextureEncoding;
179
179
 
180
180
  /**
181
- * @default false
181
+ * @default true
182
182
  */
183
- physicallyCorrectLights: boolean;
183
+ useLegacyLights: boolean;
184
184
 
185
185
  /**
186
186
  * @default THREE.NoToneMapping
@@ -1,18 +1,19 @@
1
1
  import { WebGLCapabilities } from './WebGLCapabilities';
2
2
  import { BufferAttribute } from '../../core/BufferAttribute';
3
3
  import { InterleavedBufferAttribute } from '../../core/InterleavedBufferAttribute';
4
+ import { GLBufferAttribute } from '../../core/GLBufferAttribute';
4
5
 
5
6
  export class WebGLAttributes {
6
7
  constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, capabilities: WebGLCapabilities);
7
8
 
8
- get(attribute: BufferAttribute | InterleavedBufferAttribute): {
9
+ get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): {
9
10
  buffer: WebGLBuffer;
10
11
  type: number;
11
12
  bytesPerElement: number;
12
13
  version: number;
13
14
  };
14
15
 
15
- remove(attribute: BufferAttribute | InterleavedBufferAttribute): void;
16
+ remove(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): void;
16
17
 
17
- update(attribute: BufferAttribute | InterleavedBufferAttribute, bufferType: number): void;
18
+ update(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute, bufferType: number): void;
18
19
  }
@@ -1,5 +1,6 @@
1
1
  import { Camera } from './../../cameras/Camera';
2
2
  import { Material } from './../../materials/Material';
3
+ import { Plane } from '../../math/Plane';
3
4
  import { WebGLProperties } from './WebGLProperties';
4
5
 
5
6
  export class WebGLClipping {
@@ -17,8 +18,9 @@ export class WebGLClipping {
17
18
  */
18
19
  numIntersection: number;
19
20
 
20
- init(planes: any[], enableLocalClipping: boolean, camera: Camera): boolean;
21
+ init(planes: any[], enableLocalClipping: boolean): boolean;
21
22
  beginShadows(): void;
22
23
  endShadows(): void;
24
+ setGlobalState(planes: Plane[], camera: Camera): void;
23
25
  setState(material: Material, camera: Camera, useCache: boolean): void;
24
26
  }
@@ -40,12 +40,12 @@ export class WebXRManager extends EventDispatcher {
40
40
  getBinding(): XRWebGLBinding;
41
41
  getFrame(): XRFrame;
42
42
  getSession(): XRSession | null;
43
- setSession(value: XRSession): Promise<void>;
43
+ setSession(value: XRSession | null): Promise<void>;
44
44
  getCamera(): WebXRArrayCamera;
45
45
  updateCamera(camera: PerspectiveCamera): void;
46
46
  setAnimationLoop(callback: XRFrameRequestCallback | null): void;
47
47
  getFoveation(): number | undefined;
48
- setFoveation(foveation: number): void;
48
+ setFoveation(value: number): void;
49
49
 
50
50
  /**
51
51
  * Returns the set of planes detected by WebXR's plane detection API.
@@ -1,5 +1,5 @@
1
1
  import { Texture } from './Texture';
2
- import { TextureFilter } from '../constants';
2
+ import { TextureFilter, Wrapping } from '../constants';
3
3
 
4
4
  export class Data3DTexture extends Texture {
5
5
  constructor(data: BufferSource, width: number, height: number, depth: number);
@@ -17,7 +17,7 @@ export class Data3DTexture extends Texture {
17
17
  /**
18
18
  * @default THREE.ClampToEdgeWrapping
19
19
  */
20
- wrapR: boolean;
20
+ wrapR: Wrapping;
21
21
 
22
22
  /**
23
23
  * @default false
three/src/utils.d.ts CHANGED
@@ -1,3 +1,6 @@
1
- import { Color } from './math/Color';
1
+ import { Color, ColorKeyword } from './math/Color';
2
2
 
3
- export type ColorRepresentation = Color | string | number;
3
+ export type ColorModelString = `${'rgb' | 'hsl'}(${string})`;
4
+ export type HexColorString = `#${string}`;
5
+
6
+ export type ColorRepresentation = Color | ColorKeyword | ColorModelString | HexColorString | number;