@types/three 0.149.0 → 0.150.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 (103) 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 +5 -0
  6. three/examples/jsm/controls/TransformControls.d.ts +1 -5
  7. three/examples/jsm/geometries/TextGeometry.d.ts +92 -15
  8. three/examples/jsm/helpers/OctreeHelper.d.ts +1 -1
  9. three/examples/jsm/libs/fflate.module.d.ts +1 -0
  10. three/examples/jsm/libs/lil-gui.module.min.d.ts +1 -0
  11. three/examples/jsm/libs/stats.module.d.ts +2 -23
  12. three/examples/jsm/loaders/EXRLoader.d.ts +3 -2
  13. three/examples/jsm/misc/GPUComputationRenderer.d.ts +4 -2
  14. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +3 -4
  15. three/examples/jsm/objects/MarchingCubes.d.ts +1 -0
  16. three/examples/jsm/shaders/VelocityShader.d.ts +2 -2
  17. three/index.d.ts +1 -1
  18. three/package.json +19 -4
  19. three/src/Three.d.ts +0 -1
  20. three/src/audio/Audio.d.ts +184 -20
  21. three/src/audio/AudioAnalyser.d.ts +42 -4
  22. three/src/audio/AudioContext.d.ts +12 -1
  23. three/src/audio/AudioListener.d.ts +76 -8
  24. three/src/audio/PositionalAudio.d.ts +86 -5
  25. three/src/cameras/ArrayCamera.d.ts +23 -2
  26. three/src/cameras/Camera.d.ts +42 -13
  27. three/src/cameras/CubeCamera.d.ts +49 -1
  28. three/src/cameras/OrthographicCamera.d.ts +77 -25
  29. three/src/cameras/PerspectiveCamera.d.ts +132 -56
  30. three/src/cameras/StereoCamera.d.ts +29 -2
  31. three/src/constants.d.ts +790 -245
  32. three/src/core/BufferAttribute.d.ts +456 -85
  33. three/src/core/BufferGeometry.d.ts +237 -67
  34. three/src/core/Clock.d.ts +28 -20
  35. three/src/core/EventDispatcher.d.ts +20 -4
  36. three/src/core/GLBufferAttribute.d.ts +102 -8
  37. three/src/core/InstancedBufferAttribute.d.ts +13 -24
  38. three/src/core/InstancedBufferGeometry.d.ts +22 -4
  39. three/src/core/InstancedInterleavedBuffer.d.ts +10 -2
  40. three/src/core/InterleavedBuffer.d.ts +98 -14
  41. three/src/core/InterleavedBufferAttribute.d.ts +146 -7
  42. three/src/core/Layers.d.ts +61 -6
  43. three/src/core/Object3D.d.ts +244 -123
  44. three/src/core/Raycaster.d.ts +104 -27
  45. three/src/core/Uniform.d.ts +28 -11
  46. three/src/core/UniformsGroup.d.ts +10 -4
  47. three/src/extras/Earcut.d.ts +3 -4
  48. three/src/geometries/BoxGeometry.d.ts +39 -16
  49. three/src/geometries/CapsuleGeometry.d.ts +35 -12
  50. three/src/geometries/CircleGeometry.d.ts +38 -12
  51. three/src/geometries/ConeGeometry.d.ts +45 -10
  52. three/src/geometries/CylinderGeometry.d.ts +41 -19
  53. three/src/geometries/DodecahedronGeometry.d.ts +14 -5
  54. three/src/geometries/EdgesGeometry.d.ts +30 -8
  55. three/src/geometries/ExtrudeGeometry.d.ts +93 -12
  56. three/src/geometries/IcosahedronGeometry.d.ts +15 -5
  57. three/src/geometries/LatheGeometry.d.ts +41 -12
  58. three/src/geometries/OctahedronGeometry.d.ts +14 -5
  59. three/src/geometries/PlaneGeometry.d.ts +35 -12
  60. three/src/geometries/PolyhedronGeometry.d.ts +41 -12
  61. three/src/geometries/RingGeometry.d.ts +39 -16
  62. three/src/geometries/ShapeGeometry.d.ts +44 -4
  63. three/src/geometries/SphereGeometry.d.ts +43 -21
  64. three/src/geometries/TetrahedronGeometry.d.ts +14 -5
  65. three/src/geometries/TorusGeometry.d.ts +35 -13
  66. three/src/geometries/TorusKnotGeometry.d.ts +39 -16
  67. three/src/geometries/TubeGeometry.d.ts +63 -15
  68. three/src/geometries/WireframeGeometry.d.ts +30 -4
  69. three/src/materials/MeshPhysicalMaterial.d.ts +13 -1
  70. three/src/math/Color.d.ts +157 -3
  71. three/src/math/ColorManagement.d.ts +13 -7
  72. three/src/objects/Bone.d.ts +30 -3
  73. three/src/objects/Group.d.ts +37 -1
  74. three/src/objects/InstancedMesh.d.ts +122 -3
  75. three/src/objects/LOD.d.ts +62 -18
  76. three/src/objects/Line.d.ts +67 -4
  77. three/src/objects/LineLoop.d.ts +26 -1
  78. three/src/objects/LineSegments.d.ts +21 -9
  79. three/src/objects/Mesh.d.ts +60 -4
  80. three/src/objects/Points.d.ts +39 -8
  81. three/src/objects/Skeleton.d.ts +89 -3
  82. three/src/objects/SkinnedMesh.d.ts +122 -3
  83. three/src/objects/Sprite.d.ts +51 -4
  84. three/src/renderers/WebGLRenderTarget.d.ts +9 -3
  85. three/src/renderers/WebGLRenderer.d.ts +2 -2
  86. three/src/scenes/Fog.d.ts +59 -7
  87. three/src/scenes/FogExp2.d.ts +41 -6
  88. three/src/scenes/Scene.d.ts +45 -22
  89. three/src/textures/CanvasTexture.d.ts +35 -13
  90. three/src/textures/CompressedArrayTexture.d.ts +39 -5
  91. three/src/textures/CompressedTexture.d.ts +49 -20
  92. three/src/textures/CubeTexture.d.ts +71 -18
  93. three/src/textures/Data3DTexture.d.ts +74 -10
  94. three/src/textures/DataArrayTexture.d.ts +83 -9
  95. three/src/textures/DataTexture.d.ts +81 -26
  96. three/src/textures/DepthTexture.d.ts +71 -15
  97. three/src/textures/FramebufferTexture.d.ts +57 -2
  98. three/src/textures/Source.d.ts +23 -13
  99. three/src/textures/Texture.d.ts +289 -73
  100. three/src/textures/VideoTexture.d.ts +69 -13
  101. three/src/textures/types.d.ts +9 -0
  102. three/src/utils.d.ts +5 -2
  103. three/examples/jsm/libs/fflate.module.min.d.ts +0 -1185
@@ -1,16 +1,25 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating a dodecahedron geometries.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/DodecahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/DodecahedronGeometry.js | Source}
7
+ */
3
8
  export class DodecahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link DodecahedronGeometry}
11
+ * @param radius Radius of the dodecahedron. Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than 0 adds vertices making it no longer a dodecahedron. Expects a `Integer`. Default `0`
7
13
  */
8
14
  constructor(radius?: number, detail?: number);
9
15
 
10
16
  /**
11
- * @default 'DodecahedronGeometry'
17
+ * A Read-only _string_ to check if `this` object type.
18
+ * @remarks Sub-classes will update this value.
19
+ * @defaultValue `DodecahedronGeometry`
12
20
  */
13
- type: string;
21
+ override readonly type: string | 'DodecahedronGeometry';
14
22
 
15
- static fromJSON(data: any): DodecahedronGeometry;
23
+ /** @internal */
24
+ static fromJSON(data: {}): DodecahedronGeometry;
16
25
  }
@@ -1,19 +1,41 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * This can be used as a helper object to view the edges of a {@link THREE.BufferGeometry | geometry}.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.BoxGeometry(100, 100, 100);
8
+ * const edges = new THREE.EdgesGeometry(geometry);
9
+ * const line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({
10
+ * color: 0xffffff
11
+ * }));
12
+ * scene.add(line);
13
+ * ```
14
+ * @see Example: {@link https://threejs.org/examples/#webgl_helpers | helpers}
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/EdgesGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/EdgesGeometry.js | Source}
17
+ */
3
18
  export class EdgesGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
4
19
  /**
5
- * @param geometry
6
- * @param [thresholdAngle=1]
20
+ * Create a new instance of {@link EdgesGeometry}
21
+ * @param geometry Any geometry object. Default `null`.
22
+ * @param thresholdAngle An edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. Expects a `Integer`. Default `1` _degree_.
7
23
  */
8
- constructor(geometry?: TBufferGeometry, thresholdAngle?: number);
24
+ constructor(geometry?: TBufferGeometry | null, thresholdAngle?: number);
9
25
 
10
26
  /**
11
- * @default 'EdgesGeometry'
27
+ * A Read-only _string_ to check if `this` object type.
28
+ * @remarks Sub-classes will update this value.
29
+ * @defaultValue `EdgesGeometry`
12
30
  */
13
- type: string;
31
+ override readonly type: string | 'EdgesGeometry';
14
32
 
15
- parameters: {
16
- geometry: TBufferGeometry;
17
- thresholdAngle: number;
33
+ /**
34
+ * An object with a property for each of the constructor parameters.
35
+ * @remarks Any modification after instantiation does not change the geometry.
36
+ */
37
+ readonly parameters: {
38
+ readonly geometry: TBufferGeometry | null;
39
+ readonly thresholdAngle: number;
18
40
  };
19
41
  }
@@ -6,35 +6,67 @@ import { BufferGeometry } from './../core/BufferGeometry';
6
6
 
7
7
  export interface ExtrudeGeometryOptions {
8
8
  /**
9
- * @default 12
9
+ * Number of points on the curves.
10
+ * Expects a `Integer`.
11
+ * @defaultValue `12`
10
12
  */
11
13
  curveSegments?: number | undefined;
14
+
12
15
  /**
13
- * @default 1
16
+ * Number of points used for subdividing segments along the depth of the extruded spline.
17
+ * @defaultValue `1`
14
18
  */
15
19
  steps?: number | undefined;
20
+
16
21
  /**
17
- * @default 100
22
+ * Depth to extrude the shape.
23
+ * @defaultValue `1`
18
24
  */
19
25
  depth?: number | undefined;
26
+
20
27
  /**
21
- * @default true
28
+ * Turn on bevel. Applying beveling to the shape.
29
+ * @defaultValue `true`
22
30
  */
23
31
  bevelEnabled?: boolean | undefined;
32
+
24
33
  /**
25
- * @default 6
34
+ * How deep into the original shape the bevel goes.
35
+ * Expects a `Float`.
36
+ * @defaultValue `0.2`
26
37
  */
27
38
  bevelThickness?: number | undefined;
39
+
40
+ /**
41
+ * Distance from the shape outline that the bevel extends
42
+ * Expects a `Float`.
43
+ * @defaultValue `bevelThickness - 0.1`
44
+ */
28
45
  bevelSize?: number | undefined;
46
+
29
47
  /**
30
- * @default 0
48
+ * Distance from the shape outline that the bevel starts.
49
+ * Expects a `Float`.
50
+ * @defaultValue `0`
31
51
  */
32
52
  bevelOffset?: number | undefined;
53
+
33
54
  /**
34
- * @default 3
55
+ * Number of bevel layers/segments.
56
+ * Expects a `Integer`.
57
+ * @defaultValue `3`
35
58
  */
36
59
  bevelSegments?: number | undefined;
60
+
61
+ /**
62
+ * A 3D spline path along which the shape should be extruded.
63
+ * @remarks Bevels not supported for path extrusion.
64
+ */
37
65
  extrudePath?: Curve<Vector3> | undefined;
66
+
67
+ /**
68
+ * A object that provides UV generator functions.
69
+ */
38
70
  UVGenerator?: UVGenerator | undefined;
39
71
  }
40
72
 
@@ -56,16 +88,65 @@ export interface UVGenerator {
56
88
  ): Vector2[];
57
89
  }
58
90
 
91
+ /**
92
+ * Creates extruded geometry from a path shape.
93
+ * @remarks This object extrudes a 2D shape to a 3D geometry.
94
+ * @remarks When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials
95
+ * @remarks The first material will be applied to the face; the second material will be applied to the sides.
96
+ * @example
97
+ * ```typescript
98
+ * const length = 12, width = 8;
99
+ * const shape = new THREE.Shape();
100
+ * shape.moveTo(0, 0);
101
+ * shape.lineTo(0, width);
102
+ * shape.lineTo(length, width);
103
+ * shape.lineTo(length, 0);
104
+ * shape.lineTo(0, 0);
105
+ * const extrudeSettings = {
106
+ * steps: 2,
107
+ * depth: 16,
108
+ * bevelEnabled: true,
109
+ * bevelThickness: 1,
110
+ * bevelSize: 1,
111
+ * bevelOffset: 0,
112
+ * bevelSegments: 1
113
+ * };
114
+ * const geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
115
+ * const material = new THREE.MeshBasicMaterial({
116
+ * color: 0x00ff00
117
+ * });
118
+ * const mesh = new THREE.Mesh(geometry, material);
119
+ * scene.add(mesh);
120
+ * ```
121
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/ExtrudeGeometry | Official Documentation}
122
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/ExtrudeGeometry.js | Source}
123
+ */
59
124
  export class ExtrudeGeometry extends BufferGeometry {
125
+ /**
126
+ * Create a new instance of {@link ExtrudeGeometry}
127
+ * @param shapes Shape or an array of shapes. Default `new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)])`.
128
+ * @param options Object that can contain the following parameters. @see {@link ExtrudeGeometryOptions} for defaults.
129
+ */
60
130
  constructor(shapes?: Shape | Shape[], options?: ExtrudeGeometryOptions);
61
131
 
62
132
  /**
63
- * @default 'ExtrudeGeometry'
133
+ * A Read-only _string_ to check if `this` object type.
134
+ * @remarks Sub-classes will update this value.
135
+ * @defaultValue `ExtrudeGeometry`
136
+ */
137
+ override readonly type: string | 'ExtrudeGeometry';
138
+
139
+ /**
140
+ * An object with a property for each of the constructor parameters.
141
+ * @remarks Any modification after instantiation does not change the geometry.
64
142
  */
65
- type: string;
143
+ readonly parameters: {
144
+ readonly shapes: Shape | Shape[];
145
+ readonly options: ExtrudeGeometryOptions;
146
+ };
66
147
 
67
- addShapeList(shapes: Shape[], options?: any): void;
68
- addShape(shape: Shape, options?: any): void;
148
+ addShape(shape: Shape): void;
69
149
 
70
- static fromJSON(data: any): ExtrudeGeometry;
150
+ /** @internal */
151
+ static fromJSON(data: {}, shapes: unknown): ExtrudeGeometry;
71
152
  }
@@ -1,16 +1,26 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating an icosahedron geometry.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/IcosahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/IcosahedronGeometry.js | Source}
7
+ */
3
8
  export class IcosahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link IcosahedronGeometry}
11
+ * @param radius Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than 0 adds more vertices making it no longer an icosahedron.
13
+ * When detail is greater than 1, it's effectively a sphere. Expects a `Integer`. Default `0`
7
14
  */
8
15
  constructor(radius?: number, detail?: number);
9
16
 
10
17
  /**
11
- * @default 'IcosahedronGeometry'
18
+ * A Read-only _string_ to check if `this` object type.
19
+ * @remarks Sub-classes will update this value.
20
+ * @defaultValue `IcosahedronGeometry`
12
21
  */
13
- type: string;
22
+ override readonly type: string | 'IcosahedronGeometry';
14
23
 
15
- static fromJSON(data: any): IcosahedronGeometry;
24
+ /** @internal */
25
+ static fromJSON(data: {}): IcosahedronGeometry;
16
26
  }
@@ -1,26 +1,55 @@
1
1
  import { Vector2 } from './../math/Vector2';
2
2
  import { BufferGeometry } from './../core/BufferGeometry';
3
3
 
4
+ /**
5
+ * Creates meshes with axial symmetry like vases
6
+ * @remarks
7
+ * The lathe rotates around the Y axis.
8
+ * @example
9
+ * ```typescript
10
+ * const points = [];
11
+ * for (let i = 0; i & lt; 10; i++) {
12
+ * points.push(new THREE.Vector2(Math.sin(i * 0.2) * 10 + 5, (i - 5) * 2));
13
+ * }
14
+ * const geometry = new THREE.LatheGeometry(points);
15
+ * const material = new THREE.MeshBasicMaterial({
16
+ * color: 0xffff00
17
+ * });
18
+ * const lathe = new THREE.Mesh(geometry, material);
19
+ * scene.add(lathe);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/LatheGeometry | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/LatheGeometry.js | Source}
23
+ */
4
24
  export class LatheGeometry extends BufferGeometry {
5
25
  /**
6
- * @param points
7
- * @param [segments=12]
8
- * @param [phiStart=0]
9
- * @param [phiLength=Math.PI * 2]
26
+ * This creates a {@link LatheGeometry} based on the parameters.
27
+ * @param points Array of Vector2s. The x-coordinate of each point must be greater than zero.
28
+ * Default `[new Vector2(0, -0.5), new Vector2(0.5, 0), new Vector2(0, 0.5)]` _which creates a simple diamond shape_.
29
+ * @param segments The number of circumference segments to generate. Expects a `Integer`. Default `12`.
30
+ * @param phiStart The starting angle in radians. Expects a `Float`. Default `0`.
31
+ * @param phiLength The radian (0 to 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Expects a `Float`. Default `Math.PI * 2`.
10
32
  */
11
33
  constructor(points?: Vector2[], segments?: number, phiStart?: number, phiLength?: number);
12
34
 
13
35
  /**
14
- * @default 'LatheGeometry'
36
+ * A Read-only _string_ to check if `this` object type.
37
+ * @remarks Sub-classes will update this value.
38
+ * @defaultValue `LatheGeometry`
15
39
  */
16
- type: string;
40
+ override readonly type: string | 'LatheGeometry';
17
41
 
18
- parameters: {
19
- points: Vector2[];
20
- segments: number;
21
- phiStart: number;
22
- phiLength: number;
42
+ /**
43
+ * An object with a property for each of the constructor parameters.
44
+ * @remarks Any modification after instantiation does not change the geometry.
45
+ */
46
+ readonly parameters: {
47
+ readonly points: Vector2[];
48
+ readonly segments: number;
49
+ readonly phiStart: number;
50
+ readonly phiLength: number;
23
51
  };
24
52
 
25
- static fromJSON(data: any): LatheGeometry;
53
+ /** @internal */
54
+ static fromJSON(data: {}): LatheGeometry;
26
55
  }
@@ -1,16 +1,25 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating an octahedron geometry.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/OctahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/OctahedronGeometry.js | Source}
7
+ */
3
8
  export class OctahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link OctahedronGeometry}
11
+ * @param radius Radius of the octahedron. Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than zero add vertices making it no longer an octahedron. Expects a `Integer`. Default `0`
7
13
  */
8
14
  constructor(radius?: number, detail?: number);
9
15
 
10
16
  /**
11
- * @default 'OctahedronGeometry'
17
+ * A Read-only _string_ to check if `this` object type.
18
+ * @remarks Sub-classes will update this value.
19
+ * @defaultValue `OctahedronGeometry`
12
20
  */
13
- type: string;
21
+ override readonly type: string | 'OctahedronGeometry';
14
22
 
15
- static fromJSON(data: any): OctahedronGeometry;
23
+ /** @internal */
24
+ static fromJSON(data: {}): OctahedronGeometry;
16
25
  }
@@ -1,25 +1,48 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating plane geometries.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.PlaneGeometry(1, 1);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00,
10
+ * side: THREE.DoubleSide
11
+ * });
12
+ * const plane = new THREE.Mesh(geometry, material);
13
+ * scene.add(plane);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/PlaneGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/PlaneGeometry.js | Source}
17
+ */
3
18
  export class PlaneGeometry extends BufferGeometry {
4
19
  /**
5
- * @param [width=1] Width of the sides on the X axis.
6
- * @param [height=1] Height of the sides on the Y axis.
7
- * @param [widthSegments=1] Number of segmented faces along the width of the sides.
8
- * @param [heightSegments=1] Number of segmented faces along the height of the sides.
20
+ * Create a new instance of {@link PlaneGeometry}
21
+ * @param width Width along the X axis. Expects a `Float`. Default `1`
22
+ * @param height Height along the Y axis. Expects a `Float`. Default `1`
23
+ * @param widthSegments Number of segmented faces along the width of the sides. Expects a `Integer`. Default `1`
24
+ * @param heightSegments Number of segmented faces along the height of the sides. Expects a `Integer`. Default `1`
9
25
  */
10
26
  constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number);
11
27
 
12
28
  /**
13
- * @default 'PlaneGeometry'
29
+ * A Read-only _string_ to check if `this` object type.
30
+ * @remarks Sub-classes will update this value.
31
+ * @defaultValue `PlaneGeometry`
14
32
  */
15
- type: string;
33
+ override readonly type: string | 'PlaneGeometry';
16
34
 
17
- parameters: {
18
- width: number;
19
- height: number;
20
- widthSegments: number;
21
- heightSegments: number;
35
+ /**
36
+ * An object with a property for each of the constructor parameters.
37
+ * @remarks Any modification after instantiation does not change the geometry.
38
+ */
39
+ readonly parameters: {
40
+ readonly width: number;
41
+ readonly height: number;
42
+ readonly widthSegments: number;
43
+ readonly heightSegments: number;
22
44
  };
23
45
 
24
- static fromJSON(data: any): PlaneGeometry;
46
+ /** @internal */
47
+ static fromJSON(data: {}): PlaneGeometry;
25
48
  }
@@ -1,25 +1,54 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A polyhedron is a solid in three dimensions with flat faces
5
+ * @remarks
6
+ * This class will take an array of vertices, project them onto a sphere, and then divide them up to the desired level of detail
7
+ * This class is used by {@link THREE.DodecahedronGeometry | DodecahedronGeometry}, {@link THREE.IcosahedronGeometry | IcosahedronGeometry},
8
+ * {@link THREE.OctahedronGeometry | OctahedronGeometry}, and {@link THREE.TetrahedronGeometry | TetrahedronGeometry} to generate their respective geometries.
9
+ * @example
10
+ * ```typescript
11
+ * const verticesOfCube = [-1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, ];
12
+ * const indicesOfFaces = [
13
+ * 2, 1, 0, 0, 3, 2,
14
+ * 0, 4, 7, 7, 3, 0,
15
+ * 0, 1, 5, 5, 4, 0,
16
+ * 1, 2, 6, 6, 5, 1,
17
+ * 2, 3, 7, 7, 6, 2,
18
+ * 4, 5, 6, 6, 7, 4];
19
+ * const geometry = new THREE.PolyhedronGeometry(verticesOfCube, indicesOfFaces, 6, 2);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/PolyhedronGeometry | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/PolyhedronGeometry.js | Source}
23
+ */
3
24
  export class PolyhedronGeometry extends BufferGeometry {
4
25
  /**
5
- * @param vertices
6
- * @param indices
7
- * @param [radius=1]
8
- * @param [detail=0]
26
+ * Create a new instance of {@link PolyhedronGeometry}
27
+ * @param vertices Array of points of the form [1,1,1, -1,-1,-1, ... ]. Default `[]`.
28
+ * @param indices Array of indices that make up the faces of the form [0,1,2, 2,3,0, ... ]. Default `[]`.
29
+ * @param radius [page:The radius of the final shape Expects a `Float`. Default `1`
30
+ * @param detail [page:How many levels to subdivide the geometry. The more detail, the smoother the shape. Expects a `Integer`. Default `0`
9
31
  */
10
32
  constructor(vertices?: number[], indices?: number[], radius?: number, detail?: number);
11
33
 
12
34
  /**
13
- * @default 'PolyhedronGeometry'
35
+ * A Read-only _string_ to check if `this` object type.
36
+ * @remarks Sub-classes will update this value.
37
+ * @defaultValue `PolyhedronGeometry`
14
38
  */
15
- type: string;
39
+ override readonly type: string | 'PolyhedronGeometry';
16
40
 
17
- parameters: {
18
- vertices: number[];
19
- indices: number[];
20
- radius: number;
21
- detail: number;
41
+ /**
42
+ * An object with a property for each of the constructor parameters.
43
+ * @remarks Any modification after instantiation does not change the geometry.
44
+ */
45
+ readonly parameters: {
46
+ readonly vertices: number[];
47
+ readonly indices: number[];
48
+ readonly radius: number;
49
+ readonly detail: number;
22
50
  };
23
51
 
24
- static fromJSON(data: any): PolyhedronGeometry;
52
+ /** @internal */
53
+ static fromJSON(data: {}): PolyhedronGeometry;
25
54
  }
@@ -1,13 +1,29 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating a two-dimensional ring geometry.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.RingGeometry(1, 5, 32);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00,
10
+ * side: THREE.DoubleSide
11
+ * });
12
+ * const mesh = new THREE.Mesh(geometry, material);
13
+ * scene.add(mesh);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/RingGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/RingGeometry.js | Source}
17
+ */
3
18
  export class RingGeometry extends BufferGeometry {
4
19
  /**
5
- * @param innerRadius - Default is 0.5.
6
- * @param outerRadius - Default is 1.
7
- * @param thetaSegments - Number of segments. A higher number means the ring will be more round. Minimum is 3. Default is 32.
8
- * @param phiSegments - Minimum is 1. Default is 1.
9
- * @param thetaStart - Starting angle. Default is 0.
10
- * @param thetaLength - Central angle. Default is Math.PI * 2.
20
+ * Create a new instance of {@link RingGeometry}
21
+ * @param innerRadius Expects a `Float`. Default `0.5`.
22
+ * @param outerRadius Expects a `Float`. Default `1`.
23
+ * @param thetaSegments Number of segments. A higher number means the ring will be more round. Minimum is 3. Expects a `Integer`. Default `32`.
24
+ * @param phiSegments Minimum is 1. Expects a `Integer`. Default `1`.
25
+ * @param thetaStart Starting angle. Expects a `Float`. Default `0`.
26
+ * @param thetaLength Central angle. Expects a `Float`. Default `Math.PI * 2`.
11
27
  */
12
28
  constructor(
13
29
  innerRadius?: number,
@@ -19,18 +35,25 @@ export class RingGeometry extends BufferGeometry {
19
35
  );
20
36
 
21
37
  /**
22
- * @default 'RingGeometry'
38
+ * A Read-only _string_ to check if `this` object type.
39
+ * @remarks Sub-classes will update this value.
40
+ * @defaultValue `RingGeometry`
23
41
  */
24
- type: string;
42
+ override readonly type: string | 'RingGeometry';
25
43
 
26
- parameters: {
27
- innerRadius: number;
28
- outerRadius: number;
29
- thetaSegments: number;
30
- phiSegments: number;
31
- thetaStart: number;
32
- thetaLength: number;
44
+ /**
45
+ * An object with a property for each of the constructor parameters.
46
+ * @remarks Any modification after instantiation does not change the geometry.
47
+ */
48
+ readonly parameters: {
49
+ readonly innerRadius: number;
50
+ readonly outerRadius: number;
51
+ readonly thetaSegments: number;
52
+ readonly phiSegments: number;
53
+ readonly thetaStart: number;
54
+ readonly thetaLength: number;
33
55
  };
34
56
 
35
- static fromJSON(data: any): RingGeometry;
57
+ /** @internal */
58
+ static fromJSON(data: {}): RingGeometry;
36
59
  }
@@ -1,13 +1,53 @@
1
1
  import { Shape } from './../extras/core/Shape';
2
2
  import { BufferGeometry } from './../core/BufferGeometry';
3
3
 
4
+ /**
5
+ * Creates an one-sided polygonal geometry from one or more path shapes.
6
+ * @example
7
+ * ```typescript
8
+ * const x = 0, y = 0;
9
+ * const heartShape = new THREE.Shape();
10
+ * heartShape.moveTo(x + 5, y + 5);
11
+ * heartShape.bezierCurveTo(x + 5, y + 5, x + 4, y, x, y);
12
+ * heartShape.bezierCurveTo(x - 6, y, x - 6, y + 7, x - 6, y + 7);
13
+ * heartShape.bezierCurveTo(x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19);
14
+ * heartShape.bezierCurveTo(x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7);
15
+ * heartShape.bezierCurveTo(x + 16, y + 7, x + 16, y, x + 10, y);
16
+ * heartShape.bezierCurveTo(x + 7, y, x + 5, y + 5, x + 5, y + 5);
17
+ * const geometry = new THREE.ShapeGeometry(heartShape);
18
+ * const material = new THREE.MeshBasicMaterial({
19
+ * color: 0x00ff00
20
+ * });
21
+ * const mesh = new THREE.Mesh(geometry, material);
22
+ * scene.add(mesh);
23
+ * ```
24
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/ShapeGeometry | Official Documentation}
25
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/ShapeGeometry.js | Source}
26
+ */
4
27
  export class ShapeGeometry extends BufferGeometry {
5
28
  /**
6
- * @default 'ShapShapeGeometryeBufferGeometry'
29
+ * Create a new instance of {@link ShapeGeometry}
30
+ * @param shapes Array of shapes or a single {@link THREE.Shape | Shape}. Default `new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)])`, _a single triangle shape_.
31
+ * @param curveSegments Number of segments per shape. Expects a `Integer`. Default `12`
7
32
  */
8
- type: string;
9
-
10
33
  constructor(shapes?: Shape | Shape[], curveSegments?: number);
11
34
 
12
- static fromJSON(data: any): ShapeGeometry;
35
+ /**
36
+ * A Read-only _string_ to check if `this` object type.
37
+ * @remarks Sub-classes will update this value.
38
+ * @defaultValue `ShapeGeometry`
39
+ */
40
+ override readonly type: string | 'ShapeGeometry';
41
+
42
+ /**
43
+ * An object with a property for each of the constructor parameters.
44
+ * @remarks Any modification after instantiation does not change the geometry.
45
+ */
46
+ readonly parameters: {
47
+ readonly shapes: Shape | Shape[];
48
+ readonly curveSegments: number;
49
+ };
50
+
51
+ /** @internal */
52
+ static fromJSON(data: {}): ShapeGeometry;
13
53
  }