Skip to content

Commit f37f997

Browse files
s-rigaudSamuel Rigaud
andauthored
Docs: improve Jsdoc types (#30603)
Co-authored-by: Samuel Rigaud <[email protected]>
1 parent ea3e5ec commit f37f997

File tree

13 files changed

+23
-23
lines changed

13 files changed

+23
-23
lines changed

src/audio/Audio.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class Audio extends Object3D {
308308
* Can only be used with compatible audio sources that allow playback control.
309309
*
310310
* @param {number} [delay=0] - The delay, in seconds, at which the audio should start playing.
311-
* @return {Audio} A reference to this instance.
311+
* @return {Audio|undefined} A reference to this instance.
312312
*/
313313
play( delay = 0 ) {
314314

@@ -352,7 +352,7 @@ class Audio extends Object3D {
352352
*
353353
* Can only be used with compatible audio sources that allow playback control.
354354
*
355-
* @return {Audio} A reference to this instance.
355+
* @return {Audio|undefined} A reference to this instance.
356356
*/
357357
pause() {
358358

@@ -394,7 +394,7 @@ class Audio extends Object3D {
394394
* Can only be used with compatible audio sources that allow playback control.
395395
*
396396
* @param {number} [delay=0] - The delay, in seconds, at which the audio should stop playing.
397-
* @return {Audio} A reference to this instance.
397+
* @return {Audio|undefined} A reference to this instance.
398398
*/
399399
stop( delay = 0 ) {
400400

@@ -456,7 +456,7 @@ class Audio extends Object3D {
456456
* Disconnects to the audio source. This is used internally on
457457
* initialisation and when setting / removing filters.
458458
*
459-
* @return {Audio} A reference to this instance.
459+
* @return {Audio|undefined} A reference to this instance.
460460
*/
461461
disconnect() {
462462

@@ -587,7 +587,7 @@ class Audio extends Object3D {
587587
* Can only be used with compatible audio sources that allow playback control.
588588
*
589589
* @param {number} [value] - The playback rate to set.
590-
* @return {Audio} A reference to this instance.
590+
* @return {Audio|undefined} A reference to this instance.
591591
*/
592592
setPlaybackRate( value ) {
593593

@@ -657,7 +657,7 @@ class Audio extends Object3D {
657657
* Can only be used with compatible audio sources that allow playback control.
658658
*
659659
* @param {boolean} value - Whether the audio should loop or not.
660-
* @return {Audio} A reference to this instance.
660+
* @return {Audio|undefined} A reference to this instance.
661661
*/
662662
setLoop( value ) {
663663

src/extras/PMREMGenerator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class PMREMGenerator {
108108
* @param {number} sigma
109109
* @param {number} near
110110
* @param {number} far
111-
* @param {?Object} [options={}]
111+
* @param {Object} [options={}]
112112
* @return {WebGLRenderTarget}
113113
*/
114114
fromScene( scene, sigma = 0, near = 0.1, far = 100, options = {} ) {
@@ -152,7 +152,7 @@ class PMREMGenerator {
152152
* The smallest supported equirectangular image size is 64 x 32.
153153
*
154154
* @param {Texture} equirectangular
155-
* @param {WebGLRenderTarget} [renderTarget=null] - Optional render target.
155+
* @param {?WebGLRenderTarget} [renderTarget=null] - Optional render target.
156156
* @return {WebGLRenderTarget}
157157
*/
158158
fromEquirectangular( equirectangular, renderTarget = null ) {

src/extras/core/Path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Path extends CurvePath {
264264
* @param {number} aStartAngle - The start angle in radians.
265265
* @param {number} aEndAngle - The end angle in radians.
266266
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
267-
* @param {boolean} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
267+
* @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
268268
* @return {Path} A reference to this path.
269269
*/
270270
absellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {

src/materials/nodes/NodeMaterial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class NodeMaterial extends Material {
257257
* simulation would be implemented as compute shaders and managed inside a `Fn` function. This function is
258258
* eventually assigned to `geometryNode`.
259259
*
260-
* @type {Function}
260+
* @type {?Function}
261261
* @default null
262262
*/
263263
this.geometryNode = null;

src/math/Color.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ class Color {
561561
*
562562
* @param {{h:0,s:0,l:0}} target - The target object that is used to store the method's result.
563563
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
564-
* @return {{h:0,s:0,l:0}} The HSL representation of this color.
564+
* @return {{h:number,s:number,l:number}} The HSL representation of this color.
565565
*/
566566
getHSL( target, colorSpace = ColorManagement.workingColorSpace ) {
567567

src/math/Line3.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Line3 {
9191
/**
9292
* Returns the squared Euclidean distance between the line' start and end point.
9393
*
94-
* @return {Vector3} The squared Euclidean distance.
94+
* @return {number} The squared Euclidean distance.
9595
*/
9696
distanceSq() {
9797

@@ -102,7 +102,7 @@ class Line3 {
102102
/**
103103
* Returns the Euclidean distance between the line' start and end point.
104104
*
105-
* @return {Vector3} The Euclidean distance.
105+
* @return {number} The Euclidean distance.
106106
*/
107107
distance() {
108108

@@ -113,7 +113,7 @@ class Line3 {
113113
/**
114114
* Returns a vector at a certain position along the line segment.
115115
*
116-
* @param {Vector3} t - A value between `[0,1]` to represent a position along the line segment.
116+
* @param {number} t - A value between `[0,1]` to represent a position along the line segment.
117117
* @param {Vector3} target - The target vector that is used to store the method's result.
118118
* @return {Vector3} The delta vector.
119119
*/

src/math/Plane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class Plane {
290290
* projection of the normal at the origin onto the plane.
291291
*
292292
* @param {Vector3} target - The target vector that is used to store the method's result.
293-
* @return {boolean} The coplanar point.
293+
* @return {Vector3} The coplanar point.
294294
*/
295295
coplanarPoint( target ) {
296296

src/math/Vector2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ class Vector2 {
579579
* Calculates the cross product of the given vector with this instance.
580580
*
581581
* @param {Vector2} v - The vector to compute the cross product with.
582-
* @return {Vector2} The result of the cross product.
582+
* @return {number} The result of the cross product.
583583
*/
584584
cross( v ) {
585585

src/math/Vector3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class Vector3 {
267267
/**
268268
* Adds the given vector scaled by the given factor to this instance.
269269
*
270-
* @param {Vector3} v - The vector.
270+
* @param {Vector3|Vector4} v - The vector.
271271
* @param {number} s - The factor that scales `v`.
272272
* @return {Vector3} A reference to this vector.
273273
*/

src/nodes/core/NodeUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const hash = ( ...params ) => cyrb53( params );
7777
* Computes a cache key for the given node.
7878
*
7979
* @method
80-
* @param {Object} object - The object to be hashed.
80+
* @param {Object|Node} object - The object to be hashed.
8181
* @param {boolean} [force=false] - Whether to force a cache key computation or not.
8282
* @return {number} The hash.
8383
*/

0 commit comments

Comments
 (0)