From 84abf5e3fb13107bbb97e0f327381198c13e84d4 Mon Sep 17 00:00:00 2001 From: Samuel Rigaud Date: Thu, 6 Mar 2025 11:56:52 -0500 Subject: [PATCH] Types: fix errors --- examples/jsm/csm/CSMFrustum.js | 2 +- examples/jsm/csm/CSMShadowNode.js | 2 +- examples/jsm/curves/NURBSUtils.js | 8 ++++---- examples/jsm/exporters/GLTFExporter.js | 4 ++-- examples/jsm/exporters/PLYExporter.js | 2 +- examples/jsm/lines/LineMaterial.js | 2 +- src/textures/CanvasTexture.js | 3 +-- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/examples/jsm/csm/CSMFrustum.js b/examples/jsm/csm/CSMFrustum.js index b824eace5fb773..b9b4dbcc0cd673 100644 --- a/examples/jsm/csm/CSMFrustum.js +++ b/examples/jsm/csm/CSMFrustum.js @@ -10,7 +10,7 @@ class CSMFrustum { /** * Constructs a new CSM frustum. * - * @param {CSMFrustum~Data} data - The CSM data. + * @param {CSMFrustum~Data} [data] - The CSM data. */ constructor( data ) { diff --git a/examples/jsm/csm/CSMShadowNode.js b/examples/jsm/csm/CSMShadowNode.js index 6592ff398241f6..067c2290d93754 100644 --- a/examples/jsm/csm/CSMShadowNode.js +++ b/examples/jsm/csm/CSMShadowNode.js @@ -49,7 +49,7 @@ class CSMShadowNode extends ShadowBaseNode { * Constructs a new CSM shadow node. * * @param {DirectionalLight} light - The CSM light. - * @param {CSMShadowNode~Data} data - The CSM data. + * @param {CSMShadowNode~Data} [data={}] - The CSM data. */ constructor( light, data = {} ) { diff --git a/examples/jsm/curves/NURBSUtils.js b/examples/jsm/curves/NURBSUtils.js index 669b460c9f343d..704f0fe6d03993 100644 --- a/examples/jsm/curves/NURBSUtils.js +++ b/examples/jsm/curves/NURBSUtils.js @@ -351,7 +351,7 @@ function calcKoverI( k, i ) { * Calculates derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2. * * @param {Array} Pders - Array with derivatives. - * @return {Array} An array with derivatives for rational curve. + * @return {Array} An array with derivatives for rational curve. */ function calcRationalCurveDerivatives( Pders ) { @@ -395,7 +395,7 @@ function calcRationalCurveDerivatives( Pders ) { * @param {Array} P - The control points in homogeneous space. * @param {number} u - The parametric point. * @param {number} nd - The number of derivatives. - * @return {Array} array with derivatives for rational curve. + * @return {Array} array with derivatives for rational curve. */ function calcNURBSDerivatives( p, U, P, u, nd ) { @@ -411,7 +411,7 @@ function calcNURBSDerivatives( p, U, P, u, nd ) { * @param {number} q - The second degree of B-Spline surface. * @param {Array} U - The first knot vector. * @param {Array} V - The second knot vector. - * @param {Array} P - The control points in homogeneous space. + * @param {Array>} P - The control points in homogeneous space. * @param {number} u - The first parametric point. * @param {number} v - The second parametric point. * @param {Vector3} target - The target vector. @@ -461,7 +461,7 @@ function calcSurfacePoint( p, q, U, V, P, u, v, target ) { * @param {Array} U - The first knot vector. * @param {Array} V - The second knot vector. * @param {Array} W - The third knot vector. - * @param {Array} P - The control points in homogeneous space. + * @param {Array>>} P - The control points in homogeneous space. * @param {number} u - The first parametric point. * @param {number} v - The second parametric point. * @param {number} w - The third parametric point. diff --git a/examples/jsm/exporters/GLTFExporter.js b/examples/jsm/exporters/GLTFExporter.js index cf9ac534290886..b5eb61bb6ff25b 100644 --- a/examples/jsm/exporters/GLTFExporter.js +++ b/examples/jsm/exporters/GLTFExporter.js @@ -1075,7 +1075,7 @@ class GLTFWriter { * @param {number} componentType * @param {number} start * @param {number} count - * @param {?number} target Target usage of the BufferView + * @param {number} [target] Target usage of the BufferView * @return {Object} */ processBufferView( attribute, componentType, start, count, target ) { @@ -1264,7 +1264,7 @@ class GLTFWriter { /** * Process attribute to generate an accessor * @param {BufferAttribute} attribute Attribute to process - * @param {?BufferGeometry} geometry Geometry used for truncated draw range + * @param {?BufferGeometry} [geometry] Geometry used for truncated draw range * @param {number} [start=0] * @param {number} [count=Infinity] * @return {?number} Index of the processed accessor on the "accessors" array diff --git a/examples/jsm/exporters/PLYExporter.js b/examples/jsm/exporters/PLYExporter.js index 715cd82e9d26d5..bd9a1e9da38194 100644 --- a/examples/jsm/exporters/PLYExporter.js +++ b/examples/jsm/exporters/PLYExporter.js @@ -29,7 +29,7 @@ class PLYExporter { * @param {Object3D} object - The 3D object to export. * @param {PLYExporter~OnDone} onDone - A callback function that is executed when the export has finished. * @param {PLYExporter~Options} options - The export options. - * @return {string|ArrayBuffer} The exported PLY. + * @return {?string|ArrayBuffer} The exported PLY. */ parse( object, onDone, options = {} ) { diff --git a/examples/jsm/lines/LineMaterial.js b/examples/jsm/lines/LineMaterial.js index 45e96b87d410da..d36a2b797b6f45 100644 --- a/examples/jsm/lines/LineMaterial.js +++ b/examples/jsm/lines/LineMaterial.js @@ -662,7 +662,7 @@ class LineMaterial extends ShaderMaterial { * Whether to use alphaToCoverage or not. When enabled, this can improve the * anti-aliasing of line edges when using MSAA. * - * @type {Vector2} + * @type {boolean} */ get alphaToCoverage() { diff --git a/src/textures/CanvasTexture.js b/src/textures/CanvasTexture.js index 2bd176ca226ed4..bc800937e70d8f 100644 --- a/src/textures/CanvasTexture.js +++ b/src/textures/CanvasTexture.js @@ -13,7 +13,7 @@ class CanvasTexture extends Texture { /** * Constructs a new texture. * - * @param {HTMLCanvasElement} canvas - The HTML canvas element. + * @param {HTMLCanvasElement} [canvas] - The HTML canvas element. * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. @@ -22,7 +22,6 @@ class CanvasTexture extends Texture { * @param {number} [format=RGBAFormat] - The texture format. * @param {number} [type=UnsignedByteType] - The texture type. * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. - * @param {string} [colorSpace=NoColorSpace] - The color space value. */ constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {