ソースを参照

Node: Improve some types (#30110)

Co-authored-by: Samuel Rigaud <srigaud@duodisplay.com>
Samuel Rigaud 1 年間 前
コミット
234945cde3

+ 2 - 2
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 ) {
 

+ 2 - 2
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;
 

+ 1 - 1
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;

+ 3 - 2
src/nodes/lighting/AONode.js

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

+ 2 - 2
src/nodes/lighting/BasicLightMapNode.js

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

+ 1 - 1
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;

+ 6 - 6
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<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 ) {
 
@@ -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<vec3>}
+		 * @type {Node<vec3>?}
 		 * @default null
 		 */
 		this.backdropNode = backdropNode;
@@ -47,7 +47,7 @@ class LightingContextNode extends ContextNode {
 		/**
 		 * A backdrop alpha node.
 		 *
-		 * @type {Node<float>}
+		 * @type {Node<float>?}
 		 * @default null
 		 */
 		this.backdropAlphaNode = backdropAlphaNode;

+ 2 - 1
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;
 

粤ICP备19079148号