From 234945cde37b6ff6c8f913b81e6b278ad60d613e Mon Sep 17 00:00:00 2001 From: Samuel Rigaud <46346622+s-rigaud@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:53:29 -0500 Subject: [PATCH] Node: Improve some types (#30110) Co-authored-by: Samuel Rigaud --- src/cameras/PerspectiveCamera.js | 4 ++-- src/nodes/display/ColorSpaceNode.js | 4 ++-- src/nodes/display/ToneMappingNode.js | 2 +- src/nodes/lighting/AONode.js | 5 +++-- src/nodes/lighting/BasicLightMapNode.js | 4 ++-- src/nodes/lighting/EnvironmentNode.js | 2 +- src/nodes/lighting/LightingContextNode.js | 12 ++++++------ src/nodes/math/ConditionalNode.js | 3 ++- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/cameras/PerspectiveCamera.js b/src/cameras/PerspectiveCamera.js index 5183f010c2cd5b..19a6ebe1a72c76 100644 --- a/src/cameras/PerspectiveCamera.js +++ b/src/cameras/PerspectiveCamera.js @@ -113,8 +113,8 @@ class PerspectiveCamera extends Camera { * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. * * @param {number} distance - * @param {number} minTarget - * @param {number} maxTarget + * @param {Vector2} minTarget + * @param {Vector2} maxTarget */ getViewBounds( distance, minTarget, maxTarget ) { diff --git a/src/nodes/display/ColorSpaceNode.js b/src/nodes/display/ColorSpaceNode.js index e087593c652a4b..405ca8a5904001 100644 --- a/src/nodes/display/ColorSpaceNode.js +++ b/src/nodes/display/ColorSpaceNode.js @@ -46,14 +46,14 @@ class ColorSpaceNode extends TempNode { /** * The source color space. * - * @type {Node} + * @type {String} */ this.source = source; /** * The target color space. * - * @type {Node} + * @type {String} */ this.target = target; diff --git a/src/nodes/display/ToneMappingNode.js b/src/nodes/display/ToneMappingNode.js index bf554e7b71842c..90866fb4805455 100644 --- a/src/nodes/display/ToneMappingNode.js +++ b/src/nodes/display/ToneMappingNode.js @@ -49,7 +49,7 @@ class ToneMappingNode extends TempNode { /** * Represents the color to process. * - * @type {Node} + * @type {Node?} * @default null */ this.colorNode = colorNode; diff --git a/src/nodes/lighting/AONode.js b/src/nodes/lighting/AONode.js index 66257ff6f48275..59ddfb4ae08749 100644 --- a/src/nodes/lighting/AONode.js +++ b/src/nodes/lighting/AONode.js @@ -18,7 +18,7 @@ class AONode extends LightingNode { /** * Constructs a new AO node. * - * @param {Node} aoNode - The ambient occlusion node. + * @param {Node?} [aoNode=null] - The ambient occlusion node. */ constructor( aoNode = null ) { @@ -27,7 +27,8 @@ class AONode extends LightingNode { /** * The ambient occlusion node. * - * @type {Node} + * @type {Node?} + * @default null */ this.aoNode = aoNode; diff --git a/src/nodes/lighting/BasicLightMapNode.js b/src/nodes/lighting/BasicLightMapNode.js index 0d1ac92e8933e8..bfe68dea8ba1f3 100644 --- a/src/nodes/lighting/BasicLightMapNode.js +++ b/src/nodes/lighting/BasicLightMapNode.js @@ -19,7 +19,7 @@ class BasicLightMapNode extends LightingNode { /** * Constructs a new basic light map node. * - * @param {Node} lightMapNode - The light map node. + * @param {Node?} [lightMapNode=null] - The light map node. */ constructor( lightMapNode = null ) { @@ -28,7 +28,7 @@ class BasicLightMapNode extends LightingNode { /** * The light map node. * - * @type {Node} + * @type {Node?} */ this.lightMapNode = lightMapNode; diff --git a/src/nodes/lighting/EnvironmentNode.js b/src/nodes/lighting/EnvironmentNode.js index 1525ebb1709e9f..fa56a59bbab563 100644 --- a/src/nodes/lighting/EnvironmentNode.js +++ b/src/nodes/lighting/EnvironmentNode.js @@ -38,7 +38,7 @@ class EnvironmentNode extends LightingNode { /** * A node representing the environment. * - * @type {Node} + * @type {Node?} * @default null */ this.envNode = envNode; diff --git a/src/nodes/lighting/LightingContextNode.js b/src/nodes/lighting/LightingContextNode.js index dceb2027bc179b..131928d3358a2a 100644 --- a/src/nodes/lighting/LightingContextNode.js +++ b/src/nodes/lighting/LightingContextNode.js @@ -20,9 +20,9 @@ class LightingContextNode extends ContextNode { * Constructs a new lighting context node. * * @param {LightsNode} node - The lights node. - * @param {LightingModel} [lightingModel=null] - The current lighting model. - * @param {Node} [backdropNode=null] - A backdrop node. - * @param {Node} [backdropAlphaNode=null] - A backdrop alpha node. + * @param {LightingModel?} [lightingModel=null] - The current lighting model. + * @param {Node?} [backdropNode=null] - A backdrop node. + * @param {Node?} [backdropAlphaNode=null] - A backdrop alpha node. */ constructor( node, lightingModel = null, backdropNode = null, backdropAlphaNode = null ) { @@ -31,7 +31,7 @@ class LightingContextNode extends ContextNode { /** * The current lighting model. * - * @type {LightingModel} + * @type {LightingModel?} * @default null */ this.lightingModel = lightingModel; @@ -39,7 +39,7 @@ class LightingContextNode extends ContextNode { /** * A backdrop node. * - * @type {Node} + * @type {Node?} * @default null */ this.backdropNode = backdropNode; @@ -47,7 +47,7 @@ class LightingContextNode extends ContextNode { /** * A backdrop alpha node. * - * @type {Node} + * @type {Node?} * @default null */ this.backdropAlphaNode = backdropAlphaNode; diff --git a/src/nodes/math/ConditionalNode.js b/src/nodes/math/ConditionalNode.js index 2a58629c4a331a..e133237fba2a48 100644 --- a/src/nodes/math/ConditionalNode.js +++ b/src/nodes/math/ConditionalNode.js @@ -53,7 +53,8 @@ class ConditionalNode extends Node { /** * The node that is evaluate when the condition ends up `false`. * - * @type {Node} + * @type {Node?} + * @default null */ this.elseNode = elseNode;