Skip to content

Commit

Permalink
Node: Improve some types (#30110)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Rigaud <[email protected]>
  • Loading branch information
s-rigaud and Samuel Rigaud authored Dec 12, 2024
1 parent 78edc1c commit 234945c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/cameras/PerspectiveCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {

Expand Down
4 changes: 2 additions & 2 deletions src/nodes/display/ColorSpaceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/display/ToneMappingNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ToneMappingNode extends TempNode {
/**
* Represents the color to process.
*
* @type {Node}
* @type {Node?}
* @default null
*/
this.colorNode = colorNode;
Expand Down
5 changes: 3 additions & 2 deletions src/nodes/lighting/AONode.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AONode extends LightingNode {
/**
* Constructs a new AO node.
*
* @param {Node<float>} aoNode - The ambient occlusion node.
* @param {Node<float>?} [aoNode=null] - The ambient occlusion node.
*/
constructor( aoNode = null ) {

Expand All @@ -27,7 +27,8 @@ class AONode extends LightingNode {
/**
* The ambient occlusion node.
*
* @type {Node<float>}
* @type {Node<float>?}
* @default null
*/
this.aoNode = aoNode;

Expand Down
4 changes: 2 additions & 2 deletions src/nodes/lighting/BasicLightMapNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BasicLightMapNode extends LightingNode {
/**
* Constructs a new basic light map node.
*
* @param {Node<vec3>} lightMapNode - The light map node.
* @param {Node<vec3>?} [lightMapNode=null] - The light map node.
*/
constructor( lightMapNode = null ) {

Expand All @@ -28,7 +28,7 @@ class BasicLightMapNode extends LightingNode {
/**
* The light map node.
*
* @type {Node<vec3>}
* @type {Node<vec3>?}
*/
this.lightMapNode = lightMapNode;

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/lighting/EnvironmentNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EnvironmentNode extends LightingNode {
/**
* A node representing the environment.
*
* @type {Node}
* @type {Node?}
* @default null
*/
this.envNode = envNode;
Expand Down
12 changes: 6 additions & 6 deletions src/nodes/lighting/LightingContextNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<vec3>} [backdropNode=null] - A backdrop node.
* @param {Node<float>} [backdropAlphaNode=null] - A backdrop alpha node.
* @param {LightingModel?} [lightingModel=null] - The current lighting model.
* @param {Node<vec3>?} [backdropNode=null] - A backdrop node.
* @param {Node<float>?} [backdropAlphaNode=null] - A backdrop alpha node.
*/
constructor( node, lightingModel = null, backdropNode = null, backdropAlphaNode = null ) {

Expand All @@ -31,23 +31,23 @@ class LightingContextNode extends ContextNode {
/**
* The current lighting model.
*
* @type {LightingModel}
* @type {LightingModel?}
* @default null
*/
this.lightingModel = lightingModel;

/**
* A backdrop node.
*
* @type {Node<vec3>}
* @type {Node<vec3>?}
* @default null
*/
this.backdropNode = backdropNode;

/**
* A backdrop alpha node.
*
* @type {Node<float>}
* @type {Node<float>?}
* @default null
*/
this.backdropAlphaNode = backdropAlphaNode;
Expand Down
3 changes: 2 additions & 1 deletion src/nodes/math/ConditionalNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 234945c

Please sign in to comment.