Skip to content

Commit f958a13

Browse files
s-rigaudSamuel Rigaud
andauthored
JsDoc: improve type hinting for constructors (#30382)
Co-authored-by: Samuel Rigaud <[email protected]>
1 parent 0fb4b68 commit f958a13

File tree

9 files changed

+39
-33
lines changed

9 files changed

+39
-33
lines changed

editor/js/Command.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
/**
2-
* @param editor pointer to main editor object used to initialize
3-
* each command object with a reference to the editor
4-
* @constructor
5-
*/
6-
71
class Command {
82

3+
/**
4+
* @param {Editor} editor pointer to main editor object used to initialize
5+
* each command object with a reference to the editor
6+
* @constructor
7+
*/
98
constructor( editor ) {
109

1110
this.id = - 1;

examples/jsm/animation/CCDIKSolver.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,14 @@ function setPositionOfBoneToAttributeArray( array, index, bone, matrixWorldInv )
277277

278278
/**
279279
* Visualize IK bones
280-
*
281-
* @param {SkinnedMesh} mesh
282-
* @param {Array<Object>} iks
283-
* @param {number} sphereSize
284280
*/
285281
class CCDIKHelper extends Object3D {
286282

283+
/**
284+
* @param {SkinnedMesh} mesh
285+
* @param {Array<Object>} [iks=[]]
286+
* @param {number} [sphereSize=0.25]
287+
*/
287288
constructor( mesh, iks = [], sphereSize = 0.25 ) {
288289

289290
super();

examples/jsm/loaders/GCodeLoader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ import {
1414
* Gcode files are composed by commands used by machines to create objects.
1515
*
1616
* @class GCodeLoader
17-
* @param {Manager} manager Loading manager.
1817
*/
1918

2019
class GCodeLoader extends Loader {
2120

21+
/**
22+
* @param {Manager} manager Loading manager.
23+
*/
2224
constructor( manager ) {
2325

2426
super( manager );

examples/jsm/loaders/TDSLoader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
* Loads geometry with uv and materials basic properties with texture support.
2121
*
2222
* @class TDSLoader
23-
* @constructor
2423
*/
2524

2625
class TDSLoader extends Loader {

examples/jsm/misc/GPUComputationRenderer.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@ import { FullScreenQuad } from '../postprocessing/Pass.js';
9999
* // And compute each frame, before rendering to screen:
100100
* gpuCompute.doRenderTarget( myFilter1, myRenderTarget );
101101
* gpuCompute.doRenderTarget( myFilter2, outputRenderTarget );
102-
*
103-
*
104-
*
105-
* @param {int} sizeX Computation problem size is always 2d: sizeX * sizeY elements.
106-
* @param {int} sizeY Computation problem size is always 2d: sizeX * sizeY elements.
107-
* @param {WebGLRenderer} renderer The renderer
108-
*/
102+
*/
109103

110104
class GPUComputationRenderer {
111105

106+
/**
107+
* @param {Number} sizeX Computation problem size is always 2d: sizeX * sizeY elements.
108+
* @param {Number} sizeY Computation problem size is always 2d: sizeX * sizeY elements.
109+
* @param {WebGLRenderer} renderer The renderer
110+
*/
112111
constructor( sizeX, sizeY, renderer ) {
113112

114113
this.variables = [];

examples/jsm/misc/ProgressiveLightMap.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ import { potpack } from '../libs/potpack.module.js';
1313
* This should begin accumulating lightmaps which apply to
1414
* your objects, so you can start jittering lighting to achieve
1515
* the texture-space effect you're looking for.
16-
*
17-
* @param {WebGLRenderer} renderer An instance of WebGLRenderer.
18-
* @param {number} res The side-long dimension of you total lightmap.
1916
*/
2017
class ProgressiveLightMap {
2118

19+
/**
20+
* @param {WebGLRenderer} renderer An instance of WebGLRenderer.
21+
* @param {number} [res=1024] The side-long dimension of you total lightmap.
22+
*/
2223
constructor( renderer, res = 1024 ) {
2324

2425
this.renderer = renderer;

examples/jsm/misc/ProgressiveLightMapGPU.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ import { potpack } from '../libs/potpack.module.js';
1515
* This should begin accumulating lightmaps which apply to
1616
* your objects, so you can start jittering lighting to achieve
1717
* the texture-space effect you're looking for.
18-
*
19-
* @param {WebGPURenderer} renderer An instance of WebGPURenderer.
20-
* @param {number} resolution The side-long dimension of you total lightmap.
2118
*/
2219
class ProgressiveLightMap {
2320

21+
/**
22+
* @param {WebGPURenderer} renderer An instance of WebGPURenderer.
23+
* @param {number} [resolution=1024] The side-long dimension of you total lightmap.
24+
*/
2425
constructor( renderer, resolution = 1024 ) {
2526

2627
this.renderer = renderer;

examples/jsm/misc/Volume.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ import { VolumeSlice } from '../misc/VolumeSlice.js';
1111
* For now it only handles 3 dimensional data.
1212
* See the webgl_loader_nrrd.html example and the loaderNRRD.js file to see how to use this class.
1313
* @class
14-
* @param {number} xLength Width of the volume
15-
* @param {number} yLength Length of the volume
16-
* @param {number} zLength Depth of the volume
17-
* @param {string} type The type of data (uint8, uint16, ...)
18-
* @param {ArrayBuffer} arrayBuffer The buffer with volume data
1914
*/
2015
class Volume {
2116

17+
/**
18+
* @param {number} xLength Width of the volume
19+
* @param {number} yLength Length of the volume
20+
* @param {number} zLength Depth of the volume
21+
* @param {string} type The type of data (uint8, uint16, ...)
22+
* @param {ArrayBuffer} arrayBuffer The buffer with volume data
23+
*/
2224
constructor( xLength, yLength, zLength, type, arrayBuffer ) {
2325

2426
if ( xLength !== undefined ) {

examples/jsm/misc/VolumeSlice.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ import {
1212
/**
1313
* This class has been made to hold a slice of a volume data
1414
* @class
15-
* @param {Volume} volume The associated volume
16-
* @param {number} [index=0] The index of the slice
17-
* @param {string} [axis='z'] For now only 'x', 'y' or 'z' but later it will change to a normal vector
1815
* @see Volume
1916
*/
2017
class VolumeSlice {
2118

19+
/**
20+
* @param {Volume} volume The associated volume
21+
* @param {number} [index=0] The index of the slice
22+
* @param {string} [axis='z'] For now only 'x', 'y' or 'z' but later it will change to a normal vector
23+
*/
2224
constructor( volume, index, axis ) {
2325

2426
const slice = this;

0 commit comments

Comments
 (0)