Просмотр исходного кода

Type: use TS to fix issues (#30511)

Co-authored-by: Samuel Rigaud <srigaud@duodisplay.com>
Samuel Rigaud 11 месяцев назад
Родитель
Сommit
5dc5211b69

+ 1 - 1
examples/jsm/loaders/TDSLoader.js

@@ -41,7 +41,7 @@ class TDSLoader extends Loader {
 	 * Load 3ds file from url.
 	 * Load 3ds file from url.
 	 *
 	 *
 	 * @method load
 	 * @method load
-	 * @param {[type]} url URL for the file.
+	 * @param {string} url URL for the file.
 	 * @param {Function} onLoad onLoad callback, receives group Object3D as argument.
 	 * @param {Function} onLoad onLoad callback, receives group Object3D as argument.
 	 * @param {Function} onProgress onProgress callback.
 	 * @param {Function} onProgress onProgress callback.
 	 * @param {Function} onError onError callback.
 	 * @param {Function} onError onError callback.

+ 2 - 2
src/materials/nodes/PointsNodeMaterial.js

@@ -13,7 +13,7 @@ const _defaultValues = /*@__PURE__*/ new PointsMaterial();
 /**
 /**
  * Node material version of `PointsMaterial`.
  * Node material version of `PointsMaterial`.
  *
  *
- * @augments NodeMaterial
+ * @augments SpriteNodeMaterial
  */
  */
 class PointsNodeMaterial extends SpriteNodeMaterial {
 class PointsNodeMaterial extends SpriteNodeMaterial {
 
 
@@ -26,7 +26,7 @@ class PointsNodeMaterial extends SpriteNodeMaterial {
 	/**
 	/**
 	 * Constructs a new points node material.
 	 * Constructs a new points node material.
 	 *
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	 */
 	constructor( parameters ) {
 	constructor( parameters ) {
 
 

+ 1 - 1
src/materials/nodes/SpriteNodeMaterial.js

@@ -27,7 +27,7 @@ class SpriteNodeMaterial extends NodeMaterial {
 	/**
 	/**
 	 * Constructs a new sprite node material.
 	 * Constructs a new sprite node material.
 	 *
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	 */
 	constructor( parameters ) {
 	constructor( parameters ) {
 
 

+ 1 - 1
src/nodes/accessors/BufferAttributeNode.js

@@ -60,7 +60,7 @@ class BufferAttributeNode extends InputNode {
 		/**
 		/**
 		 * The buffer type (e.g. `'vec3'`).
 		 * The buffer type (e.g. `'vec3'`).
 		 *
 		 *
-		 * @type {string}
+		 * @type {?string}
 		 * @default null
 		 * @default null
 		 */
 		 */
 		this.bufferType = bufferType;
 		this.bufferType = bufferType;

+ 1 - 1
src/nodes/accessors/ReferenceNode.js

@@ -388,7 +388,7 @@ export default ReferenceNode;
  * @function
  * @function
  * @param {string} name - The name of the property the node refers to.
  * @param {string} name - The name of the property the node refers to.
  * @param {string} type - The uniform type that should be used to represent the property value.
  * @param {string} type - The uniform type that should be used to represent the property value.
- * @param {Object} object - The object the property belongs to.
+ * @param {?Object} object - The object the property belongs to.
  * @returns {ReferenceNode}
  * @returns {ReferenceNode}
  */
  */
 export const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name, type, object ) );
 export const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name, type, object ) );

+ 1 - 1
src/nodes/accessors/StorageTextureNode.js

@@ -114,7 +114,7 @@ class StorageTextureNode extends TextureNode {
 	}
 	}
 
 
 	/**
 	/**
-	 * Generates the code snippet of the stroge node. If no `storeNode`
+	 * Generates the code snippet of the storage node. If no `storeNode`
 	 * is defined, the texture node is generated as normal texture.
 	 * is defined, the texture node is generated as normal texture.
 	 *
 	 *
 	 * @param {NodeBuilder} builder - The current node builder.
 	 * @param {NodeBuilder} builder - The current node builder.

+ 3 - 3
src/nodes/core/ArrayNode.js

@@ -12,7 +12,7 @@ import { addMethodChaining, nodeObject } from '../tsl/TSLCore.js';
  *
  *
  * const redColor = tintColors.element( 0 );
  * const redColor = tintColors.element( 0 );
  *
  *
- * @augments Node
+ * @augments TempNode
  */
  */
 class ArrayNode extends TempNode {
 class ArrayNode extends TempNode {
 
 
@@ -25,8 +25,8 @@ class ArrayNode extends TempNode {
 	/**
 	/**
 	 * Constructs a new array node.
 	 * Constructs a new array node.
 	 *
 	 *
-	 * @param {string} [nodeType] - The data type of the elements.
-	 * @param {number} [count] - Size of the array.
+	 * @param {?string} nodeType - The data type of the elements.
+	 * @param {number} count - Size of the array.
 	 * @param {?Array<Node>} [values=null] - Array default values.
 	 * @param {?Array<Node>} [values=null] - Array default values.
 	 */
 	 */
 	constructor( nodeType, count, values = null ) {
 	constructor( nodeType, count, values = null ) {

+ 2 - 2
src/nodes/display/RenderOutputNode.js

@@ -39,8 +39,8 @@ class RenderOutputNode extends TempNode {
 	 * Constructs a new render output node.
 	 * Constructs a new render output node.
 	 *
 	 *
 	 * @param {Node} colorNode - The color node to process.
 	 * @param {Node} colorNode - The color node to process.
-	 * @param {number} toneMapping - The tone mapping type.
-	 * @param {string} outputColorSpace - The output color space.
+	 * @param {?number} toneMapping - The tone mapping type.
+	 * @param {?string} outputColorSpace - The output color space.
 	 */
 	 */
 	constructor( colorNode, toneMapping, outputColorSpace ) {
 	constructor( colorNode, toneMapping, outputColorSpace ) {
 
 

+ 1 - 1
src/renderers/common/TimestampQueryPool.js

@@ -39,7 +39,7 @@ class TimestampQueryPool {
 		/**
 		/**
 		 * Tracks offsets for different contexts.
 		 * Tracks offsets for different contexts.
 		 *
 		 *
-		 * @type {Map}
+		 * @type {Map<string, number>}
 		 */
 		 */
 		this.queryOffsets = new Map();
 		this.queryOffsets = new Map();
 
 

粤ICP备19079148号