Skip to content

Commit 4c20612

Browse files
s-rigaudSamuel Rigaud
andauthored
Jsdoc: More fixes (#30557)
Co-authored-by: Samuel Rigaud <[email protected]>
1 parent 4473f14 commit 4c20612

File tree

9 files changed

+42
-12
lines changed

9 files changed

+42
-12
lines changed

src/materials/Material.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ class Material extends EventDispatcher {
194194
*
195195
* This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`.
196196
*
197-
* @type {Color}
198-
* @default (0,0,0)
197+
* @type {number}
198+
* @default 0
199199
*/
200200
this.blendAlpha = 0;
201201

src/nodes/core/ArrayNode.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ class ArrayNode extends TempNode {
5858

5959
}
6060

61+
/**
62+
* Returns the node's type.
63+
*
64+
* @param {NodeBuilder} builder - The current node builder.
65+
* @return {string} The type of the node.
66+
*/
6167
getNodeType( builder ) {
6268

6369
if ( this.nodeType === null ) {
@@ -70,12 +76,24 @@ class ArrayNode extends TempNode {
7076

7177
}
7278

79+
/**
80+
* Returns the node's type.
81+
*
82+
* @param {NodeBuilder} builder - The current node builder.
83+
* @return {string} The type of the node.
84+
*/
7385
getElementType( builder ) {
7486

7587
return this.getNodeType( builder );
7688

7789
}
7890

91+
/**
92+
* This method builds the output node and returns the resulting array as a shader string.
93+
*
94+
* @param {NodeBuilder} builder - The current node builder.
95+
* @return {string} The generated shader string.
96+
*/
7997
generate( builder ) {
8098

8199
const type = this.getNodeType( builder );

src/nodes/core/UniformNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default UniformNode;
162162
* @tsl
163163
* @function
164164
* @param {any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).
165-
* @param {?string} arg2 - The node type. If no explicit type is defined, the node tries to derive the type from its value.
165+
* @param {string} [arg2] - The node type. If no explicit type is defined, the node tries to derive the type from its value.
166166
* @returns {UniformNode}
167167
*/
168168
export const uniform = ( arg1, arg2 ) => {

src/nodes/display/PassNode.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,18 @@ class PassNode extends TempNode {
654654

655655
}
656656

657+
/**
658+
* @static
659+
* @type {'color'}
660+
* @default 'color'
661+
*/
657662
PassNode.COLOR = 'color';
663+
664+
/**
665+
* @static
666+
* @type {'depth'}
667+
* @default 'depth'
668+
*/
658669
PassNode.DEPTH = 'depth';
659670

660671
export default PassNode;

src/nodes/gpgpu/ComputeBuiltinNode.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ class ComputeBuiltinNode extends Node {
9191
* Whether the current node builder has the builtin or not.
9292
*
9393
* @param {NodeBuilder} builder - The current node builder.
94+
* @return {boolean} Whether the builder has the builtin or not.
9495
*/
9596
hasBuiltin( builder ) {
9697

97-
builder.hasBuiltin( this._builtinName );
98+
return builder.hasBuiltin( this._builtinName );
9899

99100
}
100101

src/nodes/pmrem/PMREMNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function _generateCubeUVSize( imageHeight ) {
3737
* @param {Texture} texture - The texture to create the PMREM for.
3838
* @param {Renderer} renderer - The renderer.
3939
* @param {PMREMGenerator} generator - The PMREM generator.
40-
* @return {Texture} The PMREM.
40+
* @return {?Texture} The PMREM.
4141
*/
4242
function _getPMREMFromTexture( texture, renderer, generator ) {
4343

@@ -177,7 +177,7 @@ class PMREMNode extends TempNode {
177177
* Reference to a PMREM generator.
178178
*
179179
* @private
180-
* @type {PMREMGenerator}
180+
* @type {?PMREMGenerator}
181181
* @default null
182182
*/
183183
this._generator = null;

src/renderers/webgpu/nodes/WGSLNodeBuilder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ class WGSLNodeBuilder extends NodeBuilder {
793793
* Returns the native shader operator name for a given generic name.
794794
*
795795
* @param {string} op - The operator name to resolve.
796-
* @return {string} The resolved operator name.
796+
* @return {?string} The resolved operator name.
797797
*/
798798
getFunctionOperator( op ) {
799799

@@ -985,7 +985,7 @@ class WGSLNodeBuilder extends NodeBuilder {
985985
*
986986
* @param {string} name - The builtin name.
987987
* @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for.
988-
* @return {string} Whether the given builtin is defined in the given shader stage or not.
988+
* @return {boolean} Whether the given builtin is defined in the given shader stage or not.
989989
*/
990990
hasBuiltin( name, shaderStage = this.shaderStage ) {
991991

@@ -1847,7 +1847,7 @@ ${ flowData.code }
18471847
* Returns the native shader method name for a given generic name.
18481848
*
18491849
* @param {string} method - The method name to resolve.
1850-
* @param {string} [output=null] - An optional output.
1850+
* @param {?string} [output=null] - An optional output.
18511851
* @return {string} The resolved WGSL method name.
18521852
*/
18531853
getMethod( method, output = null ) {

src/renderers/webgpu/utils/WebGPUAttributeUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class WebGPUAttributeUtils {
357357
*
358358
* @private
359359
* @param {BufferAttribute} geometryAttribute - The buffer attribute.
360-
* @return {string} The vertex format (e.g. 'float32x3').
360+
* @return {string|undefined} The vertex format (e.g. 'float32x3').
361361
*/
362362
_getVertexFormat( geometryAttribute ) {
363363

src/textures/Texture.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Texture extends EventDispatcher {
3030
/**
3131
* Constructs a new texture.
3232
*
33-
* @param {Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data.
33+
* @param {?Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data.
3434
* @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.
3535
* @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.
3636
* @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.
@@ -352,7 +352,7 @@ class Texture extends EventDispatcher {
352352
/**
353353
* The image object holding the texture data.
354354
*
355-
* @type {Object}
355+
* @type {?Object}
356356
*/
357357
get image() {
358358

0 commit comments

Comments
 (0)