@types/three 0.154.0 → 0.155.1

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 (34) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/OrbitControls.d.ts +6 -0
  3. three/examples/jsm/csm/CSM.d.ts +5 -10
  4. three/examples/jsm/interactive/HTMLMesh.d.ts +2 -2
  5. three/examples/jsm/math/MeshSurfaceSampler.d.ts +9 -3
  6. three/examples/jsm/misc/RollerCoaster.d.ts +10 -5
  7. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +0 -2
  8. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
  9. three/examples/jsm/objects/ReflectorForSSRPass.d.ts +4 -0
  10. three/examples/jsm/postprocessing/AfterimagePass.d.ts +2 -2
  11. three/examples/jsm/postprocessing/HalftonePass.d.ts +16 -2
  12. three/examples/jsm/postprocessing/OutputPass.d.ts +1 -4
  13. three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts +2 -0
  14. three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
  15. three/examples/jsm/postprocessing/SSRPass.d.ts +8 -10
  16. three/examples/jsm/postprocessing/TAARenderPass.d.ts +1 -1
  17. three/examples/jsm/postprocessing/TexturePass.d.ts +4 -4
  18. three/examples/jsm/utils/BufferGeometryUtils.d.ts +3 -2
  19. three/examples/jsm/webxr/XRPlanes.d.ts +5 -0
  20. three/index.d.ts +1 -1
  21. three/package.json +2 -2
  22. three/src/Three.d.ts +1 -0
  23. three/src/core/BufferAttribute.d.ts +14 -4
  24. three/src/core/RenderTarget.d.ts +78 -0
  25. three/src/extras/core/ShapePath.d.ts +2 -3
  26. three/src/helpers/BoxHelper.d.ts +5 -3
  27. three/src/loaders/ObjectLoader.d.ts +7 -7
  28. three/src/materials/Material.d.ts +5 -5
  29. three/src/objects/Group.d.ts +1 -1
  30. three/src/renderers/WebGLRenderTarget.d.ts +5 -72
  31. three/src/renderers/WebGLRenderer.d.ts +13 -10
  32. three/src/renderers/webgl/WebGLAttributes.d.ts +8 -6
  33. three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
  34. three/src/renderers/webgl/WebGLState.d.ts +2 -13
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: Wed, 12 Jul 2023 17:02:45 GMT
11
+ * Last updated: Tue, 22 Aug 2023 18:04:44 GMT
12
12
  * Dependencies: [@types/fflate](https://npmjs.com/package/@types/fflate), [@types/lil-gui](https://npmjs.com/package/@types/lil-gui), [@types/meshoptimizer](https://npmjs.com/package/@types/meshoptimizer), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/tweenjs__tween.js](https://npmjs.com/package/@types/tweenjs__tween.js), [@types/webxr](https://npmjs.com/package/@types/webxr)
13
13
  * Global values: `THREE`
14
14
 
@@ -122,6 +122,12 @@ export class OrbitControls {
122
122
  */
123
123
  zoomSpeed: number;
124
124
 
125
+ /**
126
+ * Setting this property to `true` allows to zoom to the cursor's position.
127
+ * @default false
128
+ */
129
+ zoomToCursor: boolean;
130
+
125
131
  /**
126
132
  * Enable or disable horizontal and
127
133
  * vertical rotation of the camera.
@@ -1,18 +1,13 @@
1
1
  import { Camera, Vector3, DirectionalLight, Material, Vector2, Object3D } from '../../../src/Three.js';
2
2
 
3
- export enum CMSMode {
4
- practical = 'practical',
5
- uniform = 'uniform',
6
- logarithmic = 'logarithmic',
7
- custom = 'custom',
8
- }
3
+ export type CSMMode = 'uniform' | 'logarithmic' | 'practical' | 'custom';
9
4
 
10
- export interface CMSParameters {
5
+ export interface CSMParameters {
11
6
  camera?: Camera;
12
7
  parent?: Object3D;
13
8
  cascades?: number;
14
9
  maxFar?: number;
15
- mode?: CMSMode;
10
+ mode?: CSMMode;
16
11
  shadowMapSize?: number;
17
12
  shadowBias?: number;
18
13
  lightDirection?: Vector3;
@@ -24,12 +19,12 @@ export interface CMSParameters {
24
19
  }
25
20
 
26
21
  export class CSM {
27
- constructor(data: CMSParameters);
22
+ constructor(data: CSMParameters);
28
23
  camera: Camera;
29
24
  parent: Object3D;
30
25
  cascades: number;
31
26
  maxFar: number;
32
- mode: CMSMode;
27
+ mode: CSMMode;
33
28
  shadowMapSize: number;
34
29
  shadowBias: number;
35
30
  lightDirection: Vector3;
@@ -1,6 +1,6 @@
1
- import { Mesh } from 'three';
1
+ import { Mesh, MeshBasicMaterial, PlaneGeometry } from 'three';
2
2
 
3
- export class HTMLMesh extends Mesh {
3
+ export class HTMLMesh extends Mesh<PlaneGeometry, MeshBasicMaterial> {
4
4
  constructor(dom: HTMLElement);
5
5
  dispose(): void;
6
6
  }
@@ -1,4 +1,4 @@
1
- import { BufferGeometry, Color, Mesh, Vector3 } from '../../../src/Three.js';
1
+ import { BufferGeometry, Color, Mesh, Vector2, Vector3 } from '../../../src/Three.js';
2
2
 
3
3
  export class MeshSurfaceSampler {
4
4
  distribution: Float32Array | null;
@@ -9,7 +9,13 @@ export class MeshSurfaceSampler {
9
9
  constructor(mesh: Mesh);
10
10
  binarySearch(x: number): number;
11
11
  build(): this;
12
- sample(targetPosition: Vector3, targetNormal?: Vector3, targetColor?: Color): this;
13
- sampleFace(faceIndex: number, targetPosition: Vector3, targetNormal?: Vector3, targetColor?: Color): this;
12
+ sample(targetPosition: Vector3, targetNormal?: Vector3, targetColor?: Color, targetUV?: Vector2): this;
13
+ sampleFace(
14
+ faceIndex: number,
15
+ targetPosition: Vector3,
16
+ targetNormal?: Vector3,
17
+ targetColor?: Color,
18
+ targetUV?: Vector2,
19
+ ): this;
14
20
  setWeightAttribute(name: string | null): this;
15
21
  }
@@ -1,19 +1,24 @@
1
- import { BufferGeometry, Curve, Mesh, Vector3 } from '../../../src/Three.js';
1
+ import { BufferGeometry, Mesh, Vector3 } from '../../../src/Three.js';
2
+
3
+ interface Curve {
4
+ getPointAt(u: number): Vector3;
5
+ getTangentAt(u: number): Vector3;
6
+ }
2
7
 
3
8
  export class RollerCoasterGeometry extends BufferGeometry {
4
- constructor(curve: Curve<Vector3>, divisions: number);
9
+ constructor(curve: Curve, divisions: number);
5
10
  }
6
11
 
7
12
  export class RollerCoasterLiftersGeometry extends BufferGeometry {
8
- constructor(curve: Curve<Vector3>, divisions: number);
13
+ constructor(curve: Curve, divisions: number);
9
14
  }
10
15
 
11
16
  export class RollerCoasterShadowGeometry extends BufferGeometry {
12
- constructor(curve: Curve<Vector3>, divisions: number);
17
+ constructor(curve: Curve, divisions: number);
13
18
  }
14
19
 
15
20
  export class SkyGeometry extends BufferGeometry {
16
- constructor(curve: Curve<Vector3>, divisions: number);
21
+ constructor();
17
22
  }
18
23
 
19
24
  export class TreesGeometry extends BufferGeometry {
@@ -5,7 +5,5 @@ import { AnyJson } from '../core/constants.js';
5
5
  export default class NodeObjectLoader extends ObjectLoader {
6
6
  parseNodes(json: AnyJson, textures: { [key: string]: Texture }): NodeLoaderResult;
7
7
 
8
- // tslint:disable-next-line:comment-format
9
- //@ts-expect-error
10
8
  parseMaterials(json: AnyJson, textures: { [key: string]: Texture }): { [key: string]: Material };
11
9
  }
@@ -117,13 +117,13 @@ export type Fn<P extends FunctionNodeArguments> = P extends readonly [...unknown
117
117
  export function func<P extends FunctionNodeArguments>(
118
118
  code: string,
119
119
  includes?: CodeNodeInclude[],
120
- // eslint-disable-next-line no-unnecessary-generics
120
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
121
121
  ): { call: (...params: Fn<P>) => Swizzable };
122
122
 
123
123
  export function fn<P extends FunctionNodeArguments>(
124
124
  code: string,
125
125
  includes?: CodeNodeInclude[],
126
- // eslint-disable-next-line no-unnecessary-generics
126
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
127
127
  ): (...params: Fn<P>) => Swizzable;
128
128
 
129
129
  export function label(node: NodeRepresentation, name?: string): Swizzable<VarNode>;
@@ -7,6 +7,8 @@ import {
7
7
  Scene,
8
8
  Camera,
9
9
  IUniform,
10
+ Color,
11
+ Vector2,
10
12
  } from '../../../src/Three.js';
11
13
 
12
14
  export interface ReflectorShader {
@@ -39,6 +41,8 @@ export class ReflectorForSSRPass<TGeometry extends BufferGeometry = BufferGeomet
39
41
  needsUpdate: boolean;
40
42
  maxDistance: number;
41
43
  opacity: number;
44
+ color: Color;
45
+ resolution: Vector2;
42
46
 
43
47
  get distanceAttenuation(): boolean;
44
48
  set distanceAttenuation(val: boolean);
@@ -1,11 +1,11 @@
1
- import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three.js';
1
+ import { WebGLRenderTarget, ShaderMaterial, IUniform } from '../../../src/Three.js';
2
2
 
3
3
  import { Pass, FullScreenQuad } from './Pass.js';
4
4
 
5
5
  export class AfterimagePass extends Pass {
6
6
  constructor(damp?: number);
7
7
  shader: object;
8
- uniforms: object;
8
+ uniforms: Record<string, IUniform>;
9
9
  textureComp: WebGLRenderTarget;
10
10
  textureOld: WebGLRenderTarget;
11
11
  shaderMaterial: ShaderMaterial;
@@ -1,4 +1,4 @@
1
- import { ShaderMaterial } from '../../../src/Three.js';
1
+ import { IUniform, ShaderMaterial } from '../../../src/Three.js';
2
2
 
3
3
  import { Pass, FullScreenQuad } from './Pass.js';
4
4
 
@@ -17,7 +17,21 @@ export interface HalftonePassParameters {
17
17
 
18
18
  export class HalftonePass extends Pass {
19
19
  constructor(width: number, height: number, params: HalftonePassParameters);
20
- uniforms: object;
20
+ uniforms: {
21
+ tDiffuse: IUniform;
22
+ shape: IUniform<number>;
23
+ radius: IUniform<number>;
24
+ rotateR: IUniform<number>;
25
+ rotateG: IUniform<number>;
26
+ rotateB: IUniform<number>;
27
+ scatter: IUniform<number>;
28
+ width: IUniform<number>;
29
+ height: IUniform<number>;
30
+ blending: IUniform<number>;
31
+ blendingMode: IUniform<number>;
32
+ greyscale: IUniform<boolean>;
33
+ disable: IUniform<boolean>;
34
+ };
21
35
  material: ShaderMaterial;
22
36
  fsQuad: FullScreenQuad;
23
37
  }
@@ -1,13 +1,10 @@
1
1
  import { ShaderMaterial } from '../../../src/Three.js';
2
- import { ToneMapping } from '../../../src/constants.js';
3
2
 
4
3
  import { Pass, FullScreenQuad } from './Pass.js';
5
4
 
6
5
  export class OutputPass extends Pass {
7
- constructor(toneMapping?: ToneMapping, toneMappingExposure?: number);
6
+ constructor();
8
7
  uniforms: object;
9
8
  material: ShaderMaterial;
10
9
  fsQuad: FullScreenQuad;
11
- toneMapping: ToneMapping;
12
- toneMappingExposure: number;
13
10
  }
@@ -25,4 +25,6 @@ export class RenderPixelatedPass extends Pass {
25
25
 
26
26
  beautyRenderTarget: WebGLRenderTarget;
27
27
  normalRenderTarget: WebGLRenderTarget;
28
+
29
+ setPixelSize(pixelSize: number): void;
28
30
  }
@@ -49,7 +49,7 @@ export class SSAOPass extends Pass {
49
49
  fsQuad: FullScreenQuad;
50
50
  originalClearColor: Color;
51
51
 
52
- static OUTPUT: SSAOPassOUTPUT;
52
+ static OUTPUT: typeof SSAOPassOUTPUT;
53
53
 
54
54
  dipose(): void;
55
55
  generateSampleKernel(): Vector3[];
@@ -43,19 +43,17 @@ export class SSRPass extends Pass {
43
43
  get selects(): Mesh[] | null;
44
44
  set selects(val: Mesh[] | null);
45
45
  selective: boolean;
46
- get isBouncing(): boolean;
47
- set isBouncing(val: boolean);
46
+ get bouncing(): boolean;
47
+ set bouncing(val: boolean);
48
48
 
49
49
  blur: boolean;
50
50
 
51
- get isDistanceAttenuation(): boolean;
52
- set isDistanceAttenuation(val: boolean);
53
- get isFresnel(): boolean;
54
- set isFresnel(val: boolean);
55
- get isInfiniteThick(): boolean;
56
- set isInfiniteThick(val: boolean);
57
-
58
- thickTolerance: number;
51
+ get distanceAttenuation(): boolean;
52
+ set distanceAttenuation(val: boolean);
53
+ get fresnel(): boolean;
54
+ set fresnel(val: boolean);
55
+ get infiniteThick(): boolean;
56
+ set infiniteThick(val: boolean);
59
57
 
60
58
  beautyRenderTarget: WebGLRenderTarget;
61
59
  prevRenderTarget: WebGLRenderTarget;
@@ -3,6 +3,6 @@ import { Scene, Camera, ColorRepresentation } from '../../../src/Three.js';
3
3
  import { SSAARenderPass } from './SSAARenderPass.js';
4
4
 
5
5
  export class TAARenderPass extends SSAARenderPass {
6
- constructor(scene: Scene, camera: Camera, clearColor: ColorRepresentation, clearAlpha: number);
6
+ constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number);
7
7
  accumulate: boolean;
8
8
  }
@@ -1,12 +1,12 @@
1
- import { Texture, ShaderMaterial } from '../../../src/Three.js';
1
+ import { Texture, ShaderMaterial, IUniform } from '../../../src/Three.js';
2
2
 
3
3
  import { Pass, FullScreenQuad } from './Pass.js';
4
4
 
5
5
  export class TexturePass extends Pass {
6
- constructor(map: Texture, opacity?: number);
7
- map: Texture;
6
+ constructor(map?: Texture, opacity?: number);
7
+ map: Texture | undefined;
8
8
  opacity: number;
9
- uniforms: object;
9
+ uniforms: Record<string, IUniform>;
10
10
  material: ShaderMaterial;
11
11
  fsQuad: FullScreenQuad;
12
12
  }
@@ -28,10 +28,11 @@ export function deinterleaveAttribute(geometry: BufferGeometry): void;
28
28
  export function deinterleaveGeometry(geometry: BufferGeometry): void;
29
29
 
30
30
  /**
31
- * Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
31
+ * Modifies the supplied geometry if it is non-indexed, otherwise creates a new, non-indexed geometry. Returns the
32
+ * geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
32
33
  *
33
34
  * @param geometry The input geometry.
34
- * @param creaseAngle The crease angle.
35
+ * @param creaseAngle The crease angle in radians.
35
36
  */
36
37
  export function toCreasedNormals(geometry: BufferGeometry, creaseAngle?: number): BufferGeometry;
37
38
 
@@ -0,0 +1,5 @@
1
+ import { Object3D } from '../../../src/Three.js';
2
+
3
+ export class XRPlanes extends Object3D {
4
+ constructor(renderer: THREE.WebGLRenderer);
5
+ }
three/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for three 0.154
1
+ // Type definitions for three 0.155
2
2
  // Project: https://threejs.org/
3
3
  // Definitions by: Josh Ellis <https://github.com/joshuaellis>
4
4
  // Nathan Bierema <https://github.com/Methuselah96>
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.154.0",
3
+ "version": "0.155.1",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "lil-gui": "~0.17.0",
33
33
  "meshoptimizer": "~0.18.1"
34
34
  },
35
- "typesPublisherContentHash": "60f6509ecc6c3bb0d7b3dc3f363893442c279d1e28b9a39b682525c84ea96ca0",
35
+ "typesPublisherContentHash": "e95ca925c70bfdbc8f8ae36c5d54552fba9db84a9fa72acb7f66e8234540c623",
36
36
  "typeScriptVersion": "4.4",
37
37
  "exports": {
38
38
  ".": {
three/src/Three.d.ts CHANGED
@@ -41,6 +41,7 @@ export * from './cameras/Camera.js';
41
41
  /**
42
42
  * Core
43
43
  */
44
+ export * from './core/RenderTarget.js';
44
45
  export * from './core/Uniform.js';
45
46
  export * from './core/UniformsGroup.js';
46
47
  export * from './core/InstancedBufferGeometry.js';
@@ -114,11 +114,11 @@ export class BufferAttribute {
114
114
  normalized: boolean;
115
115
 
116
116
  /**
117
- * Stores the {@link BufferAttribute.array | array}'s length divided by the {@link BufferAttribute.itemSize | itemSize}.
118
- * @remarks If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
119
- * @remarks Expects a `Integer`
117
+ * Represents the number of items this buffer attribute stores. It is internally computed by dividing the
118
+ * {@link BufferAttribute.array | array}'s length by the {@link BufferAttribute.itemSize | itemSize}. Read-only
119
+ * property.
120
120
  */
121
- count: number;
121
+ readonly count: number;
122
122
 
123
123
  /**
124
124
  * Flag to indicate that this attribute has changed and should be re-sent to the GPU.
@@ -217,6 +217,16 @@ export class BufferAttribute {
217
217
  */
218
218
  set(value: ArrayLike<number> | ArrayBufferView, offset?: number): this;
219
219
 
220
+ /**
221
+ * Returns the given component of the vector at the given index.
222
+ */
223
+ getComponent(index: number, component: number): number;
224
+
225
+ /**
226
+ * Sets the given component of the vector at the given index.
227
+ */
228
+ setComponent(index: number, component: number, value: number): void;
229
+
220
230
  /**
221
231
  * Returns the x component of the vector at the given index.
222
232
  * @param index Expects a `Integer`
@@ -0,0 +1,78 @@
1
+ import { Vector4 } from '../math/Vector4.js';
2
+ import { Texture } from '../textures/Texture.js';
3
+ import { DepthTexture } from '../textures/DepthTexture.js';
4
+ import { EventDispatcher } from './EventDispatcher.js';
5
+ import {
6
+ Wrapping,
7
+ TextureDataType,
8
+ TextureEncoding,
9
+ MinificationTextureFilter,
10
+ MagnificationTextureFilter,
11
+ ColorSpace,
12
+ } from '../constants.js';
13
+
14
+ export interface RenderTargetOptions {
15
+ wrapS?: Wrapping | undefined;
16
+ wrapT?: Wrapping | undefined;
17
+ magFilter?: MagnificationTextureFilter | undefined;
18
+ minFilter?: MinificationTextureFilter | undefined;
19
+ generateMipmaps?: boolean | undefined; // true;
20
+ format?: number | undefined; // RGBAFormat;
21
+ type?: TextureDataType | undefined; // UnsignedByteType;
22
+ anisotropy?: number | undefined; // 1;
23
+ colorSpace?: ColorSpace | undefined;
24
+ depthBuffer?: boolean | undefined; // true;
25
+ stencilBuffer?: boolean | undefined; // false;
26
+ depthTexture?: DepthTexture | undefined;
27
+ /**
28
+ * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
29
+ * @default 0
30
+ */
31
+ samples?: number;
32
+ /** @deprecated Use 'colorSpace' in three.js r152+. */
33
+ encoding?: TextureEncoding | undefined;
34
+ }
35
+
36
+ export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher {
37
+ constructor(width?: number, height?: number, options?: RenderTargetOptions);
38
+
39
+ readonly isRenderTarget: true;
40
+
41
+ width: number;
42
+ height: number;
43
+ depth: number;
44
+
45
+ scissor: Vector4;
46
+ /**
47
+ * @default false
48
+ */
49
+ scissorTest: boolean;
50
+ viewport: Vector4;
51
+ texture: TTexture;
52
+
53
+ /**
54
+ * @default true
55
+ */
56
+ depthBuffer: boolean;
57
+
58
+ /**
59
+ * @default true
60
+ */
61
+ stencilBuffer: boolean;
62
+
63
+ /**
64
+ * @default null
65
+ */
66
+ depthTexture: DepthTexture;
67
+
68
+ /**
69
+ * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
70
+ * @default 0
71
+ */
72
+ samples: number;
73
+
74
+ setSize(width: number, height: number, depth?: number): void;
75
+ clone(): this;
76
+ copy(source: RenderTarget): this;
77
+ dispose(): void;
78
+ }
@@ -5,9 +5,8 @@ import { Path } from './Path.js';
5
5
 
6
6
  /**
7
7
  * This class is used to convert a series of shapes to an array of {@link THREE.Path | Path's},
8
- * for example an SVG shape to a path (see the example below).
9
- * @see Example: {@link https://threejs.org/examples/#webgl_geometry_extrude_shapes2 | geometry / extrude / shapes2}
10
- * @see {@link https://threejs.org/docs/index.html#api/en/extras/core/ShapePath | Official Documentation}
8
+ * for example an SVG shape to a path.
9
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/core/ShapePath | Official Documentation}
11
10
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/core/ShapePath.js | Source}
12
11
  */
13
12
  export class ShapePath {
@@ -1,6 +1,8 @@
1
1
  import { ColorRepresentation } from '../math/Color.js';
2
- import { Object3D } from './../core/Object3D.js';
3
- import { LineSegments } from './../objects/LineSegments.js';
2
+ import { Object3D } from '../core/Object3D.js';
3
+ import { LineSegments } from '../objects/LineSegments.js';
4
+ import { BufferGeometry } from '../core/BufferGeometry.js';
5
+ import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
4
6
 
5
7
  /**
6
8
  * Helper object to graphically show the world-axis-aligned bounding box around an object
@@ -21,7 +23,7 @@ import { LineSegments } from './../objects/LineSegments.js';
21
23
  * @see {@link https://threejs.org/docs/index.html#api/en/helpers/BoxHelper | Official Documentation}
22
24
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/BoxHelper.js | Source}
23
25
  */
24
- export class BoxHelper extends LineSegments {
26
+ export class BoxHelper extends LineSegments<BufferGeometry, LineBasicMaterial> {
25
27
  /**
26
28
  * Creates a new wireframe box that bounds the passed object
27
29
  * @remarks
@@ -1,9 +1,9 @@
1
1
  import { Loader } from './Loader.js';
2
2
  import { LoadingManager } from './LoadingManager.js';
3
- import { Object3D } from './../core/Object3D.js';
4
- import { Texture } from './../textures/Texture.js';
5
- import { Material } from './../materials/Material.js';
6
- import { AnimationClip } from './../animation/AnimationClip.js';
3
+ import { Object3D } from '../core/Object3D.js';
4
+ import { Texture } from '../textures/Texture.js';
5
+ import { Material } from '../materials/Material.js';
6
+ import { AnimationClip } from '../animation/AnimationClip.js';
7
7
  import { InstancedBufferGeometry } from '../core/InstancedBufferGeometry.js';
8
8
  import { BufferGeometry } from '../core/BufferGeometry.js';
9
9
  import { Source } from '../textures/Source.js';
@@ -26,12 +26,12 @@ export class ObjectLoader extends Loader {
26
26
  parse<T extends Object3D>(json: any, onLoad?: (object: Object3D) => void): T;
27
27
  // tslint:disable-next-line:no-unnecessary-generics
28
28
  parseAsync<T extends Object3D>(json: any): Promise<T>;
29
- parseGeometries(json: any): { [key: string]: InstancedBufferGeometry | BufferGeometry }; // Array of BufferGeometry or Geometry or Geometry2.
30
- parseMaterials(json: any, textures: { [key: string]: Texture }): Material[]; // Array of Classes that inherits from Matrial.
29
+ parseGeometries(json: any): { [key: string]: InstancedBufferGeometry | BufferGeometry };
30
+ parseMaterials(json: any, textures: { [key: string]: Texture }): { [key: string]: Material };
31
31
  parseAnimations(json: any): AnimationClip[];
32
32
  parseImages(json: any, onLoad?: () => void): { [key: string]: Source };
33
33
  parseImagesAsync(json: any): Promise<{ [key: string]: Source }>;
34
- parseTextures(json: any, images: any): Texture[];
34
+ parseTextures(json: any, images: { [key: string]: Source }): { [key: string]: Texture };
35
35
  parseObject<T extends Object3D>(
36
36
  data: any,
37
37
  geometries: any[],
@@ -1,7 +1,7 @@
1
- import { Plane } from './../math/Plane.js';
2
- import { EventDispatcher } from './../core/EventDispatcher.js';
3
- import { WebGLRenderer } from './../renderers/WebGLRenderer.js';
4
- import { Shader } from './../renderers/shaders/ShaderLib.js';
1
+ import { Plane } from '../math/Plane.js';
2
+ import { EventDispatcher } from '../core/EventDispatcher.js';
3
+ import { WebGLRenderer } from '../renderers/WebGLRenderer.js';
4
+ import { Shader } from '../renderers/shaders/ShaderLib.js';
5
5
  import {
6
6
  BlendingDstFactor,
7
7
  BlendingEquation,
@@ -135,7 +135,7 @@ export class Material extends EventDispatcher {
135
135
  * See the WebGL / clipping /intersection example. Default is null.
136
136
  * @default null
137
137
  */
138
- clippingPlanes: any;
138
+ clippingPlanes: Plane[];
139
139
 
140
140
  /**
141
141
  * Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
@@ -24,7 +24,7 @@ import { Object3D } from './../core/Object3D.js';
24
24
  */
25
25
  export class Group extends Object3D {
26
26
  /**
27
- * Creates a new {@link Bone}.
27
+ * Creates a new {@link Group}.
28
28
  */
29
29
  constructor();
30
30
 
@@ -1,78 +1,11 @@
1
- import { Vector4 } from '../math/Vector4.js';
2
1
  import { Texture } from '../textures/Texture.js';
3
- import { DepthTexture } from '../textures/DepthTexture.js';
4
- import { EventDispatcher } from '../core/EventDispatcher.js';
5
- import {
6
- Wrapping,
7
- TextureDataType,
8
- TextureEncoding,
9
- MinificationTextureFilter,
10
- MagnificationTextureFilter,
11
- ColorSpace,
12
- } from '../constants.js';
2
+ import { RenderTarget, RenderTargetOptions } from '../core/RenderTarget.js';
13
3
 
14
- export interface WebGLRenderTargetOptions {
15
- wrapS?: Wrapping | undefined;
16
- wrapT?: Wrapping | undefined;
17
- magFilter?: MagnificationTextureFilter | undefined;
18
- minFilter?: MinificationTextureFilter | undefined;
19
- generateMipmaps?: boolean | undefined; // true;
20
- format?: number | undefined; // RGBAFormat;
21
- type?: TextureDataType | undefined; // UnsignedByteType;
22
- anisotropy?: number | undefined; // 1;
23
- colorSpace?: ColorSpace | undefined;
24
- depthBuffer?: boolean | undefined; // true;
25
- stencilBuffer?: boolean | undefined; // false;
26
- depthTexture?: DepthTexture | undefined;
27
- /**
28
- * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
29
- * @default 0
30
- */
31
- samples?: number;
32
- /** @deprecated Use 'colorSpace' in three.js r152+. */
33
- encoding?: TextureEncoding | undefined;
34
- }
4
+ // tslint:disable-next-line:no-empty-interface
5
+ export interface WebGLRenderTargetOptions extends RenderTargetOptions {}
35
6
 
36
- export class WebGLRenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher {
37
- constructor(width?: number, height?: number, options?: WebGLRenderTargetOptions);
7
+ export class WebGLRenderTarget<TTexture extends Texture | Texture[] = Texture> extends RenderTarget<TTexture> {
8
+ constructor(width?: number, height?: number, options?: RenderTargetOptions);
38
9
 
39
10
  readonly isWebGLRenderTarget: true;
40
-
41
- width: number;
42
- height: number;
43
- depth: number;
44
-
45
- scissor: Vector4;
46
- /**
47
- * @default false
48
- */
49
- scissorTest: boolean;
50
- viewport: Vector4;
51
- texture: TTexture;
52
-
53
- /**
54
- * @default true
55
- */
56
- depthBuffer: boolean;
57
-
58
- /**
59
- * @default true
60
- */
61
- stencilBuffer: boolean;
62
-
63
- /**
64
- * @default null
65
- */
66
- depthTexture: DepthTexture;
67
-
68
- /**
69
- * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
70
- * @default 0
71
- */
72
- samples: number;
73
-
74
- setSize(width: number, height: number, depth?: number): void;
75
- clone(): this;
76
- copy(source: WebGLRenderTarget): this;
77
- dispose(): void;
78
11
  }
@@ -1,5 +1,5 @@
1
- import { Scene } from './../scenes/Scene.js';
2
- import { Camera } from './../cameras/Camera.js';
1
+ import { Scene } from '../scenes/Scene.js';
2
+ import { Camera } from '../cameras/Camera.js';
3
3
  import { WebGLExtensions } from './webgl/WebGLExtensions.js';
4
4
  import { WebGLInfo } from './webgl/WebGLInfo.js';
5
5
  import { WebGLShadowMap } from './webgl/WebGLShadowMap.js';
@@ -7,13 +7,13 @@ import { WebGLCapabilities } from './webgl/WebGLCapabilities.js';
7
7
  import { WebGLProperties } from './webgl/WebGLProperties.js';
8
8
  import { WebGLRenderLists } from './webgl/WebGLRenderLists.js';
9
9
  import { WebGLState } from './webgl/WebGLState.js';
10
- import { Vector2 } from './../math/Vector2.js';
11
- import { Vector4 } from './../math/Vector4.js';
12
- import { Color, ColorRepresentation } from './../math/Color.js';
10
+ import { Vector2 } from '../math/Vector2.js';
11
+ import { Vector4 } from '../math/Vector4.js';
12
+ import { Color, ColorRepresentation } from '../math/Color.js';
13
13
  import { WebGLRenderTarget } from './WebGLRenderTarget.js';
14
14
  import { WebGLMultipleRenderTargets } from './WebGLMultipleRenderTargets.js';
15
- import { Object3D } from './../core/Object3D.js';
16
- import { Material } from './../materials/Material.js';
15
+ import { Object3D } from '../core/Object3D.js';
16
+ import { Material } from '../materials/Material.js';
17
17
  import {
18
18
  ToneMapping,
19
19
  ShadowMapType,
@@ -22,14 +22,15 @@ import {
22
22
  ColorSpace,
23
23
  WebGLCoordinateSystem,
24
24
  } from '../constants.js';
25
- import { WebXRManager } from '../renderers/webxr/WebXRManager.js';
26
- import { BufferGeometry } from './../core/BufferGeometry.js';
25
+ import { WebXRManager } from './webxr/WebXRManager.js';
26
+ import { BufferGeometry } from '../core/BufferGeometry.js';
27
27
  import { OffscreenCanvas, Texture } from '../textures/Texture.js';
28
28
  import { Data3DTexture } from '../textures/Data3DTexture.js';
29
29
  import { Vector3 } from '../math/Vector3.js';
30
30
  import { Box3 } from '../math/Box3.js';
31
31
  import { DataArrayTexture } from '../textures/DataArrayTexture.js';
32
32
  import { WebGLProgram } from './webgl/WebGLProgram.js';
33
+ import { Plane } from '../math/Plane.js';
33
34
 
34
35
  export interface Renderer {
35
36
  domElement: HTMLCanvasElement;
@@ -184,7 +185,7 @@ export class WebGLRenderer implements Renderer {
184
185
  /**
185
186
  * @default []
186
187
  */
187
- clippingPlanes: any[];
188
+ clippingPlanes: readonly Plane[];
188
189
 
189
190
  /**
190
191
  * @default false
@@ -210,6 +211,8 @@ export class WebGLRenderer implements Renderer {
210
211
  get coordinateSystem(): typeof WebGLCoordinateSystem;
211
212
 
212
213
  /**
214
+ * @deprecated Migrate your lighting according to the following guide:
215
+ * https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.
213
216
  * @default true
214
217
  */
215
218
  useLegacyLights: boolean;
@@ -6,12 +6,14 @@ import { GLBufferAttribute } from '../../core/GLBufferAttribute.js';
6
6
  export class WebGLAttributes {
7
7
  constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, capabilities: WebGLCapabilities);
8
8
 
9
- get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): {
10
- buffer: WebGLBuffer;
11
- type: number;
12
- bytesPerElement: number;
13
- version: number;
14
- };
9
+ get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute):
10
+ | {
11
+ buffer: WebGLBuffer;
12
+ type: number;
13
+ bytesPerElement: number;
14
+ version: number;
15
+ }
16
+ | undefined;
15
17
 
16
18
  remove(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): void;
17
19
 
@@ -7,6 +7,7 @@ export class WebGLCapabilities {
7
7
  constructor(gl: WebGLRenderingContext, extensions: any, parameters: WebGLCapabilitiesParameters);
8
8
 
9
9
  readonly isWebGL2: boolean;
10
+ readonly drawBuffers: boolean;
10
11
  precision: string;
11
12
  logarithmicDepthBuffer: boolean;
12
13
  maxTextures: number;
@@ -10,6 +10,7 @@ import { WebGLCapabilities } from './WebGLCapabilities.js';
10
10
  import { WebGLExtensions } from './WebGLExtensions.js';
11
11
  import { Material } from '../../materials/Material.js';
12
12
  import { Vector4 } from '../../math/Vector4.js';
13
+ import { WebGLRenderTarget } from '../WebGLRenderTarget.js';
13
14
 
14
15
  export class WebGLColorBuffer {
15
16
  constructor();
@@ -52,22 +53,10 @@ export class WebGLState {
52
53
  stencil: WebGLStencilBuffer;
53
54
  };
54
55
 
55
- initAttributes(): void;
56
- enableAttribute(attribute: number): void;
57
- enableAttributeAndDivisor(attribute: number, meshPerAttribute: number): void;
58
- disableUnusedAttributes(): void;
59
- vertexAttribPointer(
60
- index: number,
61
- size: number,
62
- type: number,
63
- normalized: boolean,
64
- stride: number,
65
- offset: number,
66
- ): void;
67
56
  enable(id: number): void;
68
57
  disable(id: number): void;
69
58
  bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;
70
- bindXRFramebuffer(framebuffer: WebGLFramebuffer | null): void;
59
+ drawBuffers(renderTarget: WebGLRenderTarget | null, framebuffer: WebGLFramebuffer | null): void;
71
60
  useProgram(program: any): boolean;
72
61
  setBlending(
73
62
  blending: Blending,