Procházet zdrojové kódy

Docs: fix types (#30791)

Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
Samuel Rigaud před 9 měsíci
rodič
revize
b36d77dc1c

+ 2 - 2
examples/jsm/lines/LineGeometry.js

@@ -43,7 +43,7 @@ class LineGeometry extends LineSegmentsGeometry {
 	/**
 	/**
 	 * Sets the given line positions for this geometry.
 	 * Sets the given line positions for this geometry.
 	 *
 	 *
-	 * @param {Float32|Array} array - The position data to set.
+	 * @param {Float32Array|Array<number>} array - The position data to set.
 	 * @return {LineGeometry} A reference to this geometry.
 	 * @return {LineGeometry} A reference to this geometry.
 	 */
 	 */
 	setPositions( array ) {
 	setPositions( array ) {
@@ -74,7 +74,7 @@ class LineGeometry extends LineSegmentsGeometry {
 	/**
 	/**
 	 * Sets the given line colors for this geometry.
 	 * Sets the given line colors for this geometry.
 	 *
 	 *
-	 * @param {Float32|Array} array - The position data to set.
+	 * @param {Float32Array|Array<number>} array - The position data to set.
 	 * @return {LineGeometry} A reference to this geometry.
 	 * @return {LineGeometry} A reference to this geometry.
 	 */
 	 */
 	setColors( array ) {
 	setColors( array ) {

+ 2 - 2
examples/jsm/lines/LineSegmentsGeometry.js

@@ -90,7 +90,7 @@ class LineSegmentsGeometry extends InstancedBufferGeometry {
 	 * Sets the given line positions for this geometry. The length must be a multiple of six since
 	 * Sets the given line positions for this geometry. The length must be a multiple of six since
 	 * each line segment is defined by a start end vertex in the pattern `(xyz xyz)`.
 	 * each line segment is defined by a start end vertex in the pattern `(xyz xyz)`.
 	 *
 	 *
-	 * @param {Float32|Array} array - The position data to set.
+	 * @param {Float32Array|Array<number>} array - The position data to set.
 	 * @return {LineSegmentsGeometry} A reference to this geometry.
 	 * @return {LineSegmentsGeometry} A reference to this geometry.
 	 */
 	 */
 	setPositions( array ) {
 	setPositions( array ) {
@@ -127,7 +127,7 @@ class LineSegmentsGeometry extends InstancedBufferGeometry {
 	 * Sets the given line colors for this geometry. The length must be a multiple of six since
 	 * Sets the given line colors for this geometry. The length must be a multiple of six since
 	 * each line segment is defined by a start end color in the pattern `(rgb rgb)`.
 	 * each line segment is defined by a start end color in the pattern `(rgb rgb)`.
 	 *
 	 *
-	 * @param {Float32|Array} array - The position data to set.
+	 * @param {Float32Array|Array<number>} array - The position data to set.
 	 * @return {LineSegmentsGeometry} A reference to this geometry.
 	 * @return {LineSegmentsGeometry} A reference to this geometry.
 	 */
 	 */
 	setColors( array ) {
 	setColors( array ) {

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

@@ -64,7 +64,7 @@ class RGBMLoader extends DataTextureLoader {
 	/**
 	/**
 	 * Sets the maximum range.
 	 * Sets the maximum range.
 	 *
 	 *
-	 * @param {number} value - The maximum range to set.
+	 * @param {(7|16)} value - The maximum range to set.
 	 * @return {RGBMLoader} A reference to this loader.
 	 * @return {RGBMLoader} A reference to this loader.
 	 */
 	 */
 	setMaxRange( value ) {
 	setMaxRange( value ) {

+ 1 - 1
examples/jsm/postprocessing/TAARenderPass.js

@@ -78,7 +78,7 @@ class TAARenderPass extends SSAARenderPass {
 	 * @param {number} deltaTime - The delta time in seconds.
 	 * @param {number} deltaTime - The delta time in seconds.
 	 * @param {boolean} maskActive - Whether masking is active or not.
 	 * @param {boolean} maskActive - Whether masking is active or not.
 	 */
 	 */
-	render( renderer, writeBuffer, readBuffer, deltaTime ) {
+	render( renderer, writeBuffer, readBuffer, deltaTime/*, maskActive*/ ) {
 
 
 		if ( this.accumulate === false ) {
 		if ( this.accumulate === false ) {
 
 

+ 5 - 1
src/loaders/nodes/NodeLoader.js

@@ -78,7 +78,7 @@ class NodeLoader extends Loader {
 	/**
 	/**
 	 * Parse the node dependencies for the loaded node.
 	 * Parse the node dependencies for the loaded node.
 	 *
 	 *
-	 * @param {Object} json - The JSON definition
+	 * @param {Array<Object>} [json] - The JSON definition
 	 * @return {Object<string,Node>} A dictionary with node dependencies.
 	 * @return {Object<string,Node>} A dictionary with node dependencies.
 	 */
 	 */
 	parseNodes( json ) {
 	parseNodes( json ) {
@@ -119,6 +119,10 @@ class NodeLoader extends Loader {
 	 * Parses the node from the given JSON.
 	 * Parses the node from the given JSON.
 	 *
 	 *
 	 * @param {Object} json - The JSON definition
 	 * @param {Object} json - The JSON definition
+	 * @param {string} json.type - The node type.
+	 * @param {string} json.uuid - The node UUID.
+	 * @param {Array<Object>} [json.nodes] - The node dependencies.
+	 * @param {Object} [json.meta] - The meta data.
 	 * @return {Node} The parsed node.
 	 * @return {Node} The parsed node.
 	 */
 	 */
 	parse( json ) {
 	parse( json ) {

+ 3 - 3
src/materials/Material.js

@@ -151,7 +151,7 @@ class Material extends EventDispatcher {
 		 * Defines the blending equation.
 		 * Defines the blending equation.
 		 *
 		 *
 		 * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}
 		 * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}
-		 * @default OneMinusSrcAlphaFactor
+		 * @default AddEquation
 		 */
 		 */
 		this.blendEquation = AddEquation;
 		this.blendEquation = AddEquation;
 
 
@@ -174,8 +174,8 @@ class Material extends EventDispatcher {
 		/**
 		/**
 		 * Defines the blending equation of the alpha channel.
 		 * Defines the blending equation of the alpha channel.
 		 *
 		 *
-		 * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}
-		 * @default OneMinusSrcAlphaFactor
+		 * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}
+		 * @default null
 		 */
 		 */
 		this.blendEquationAlpha = null;
 		this.blendEquationAlpha = null;
 
 

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

@@ -541,7 +541,7 @@ class XRManager extends EventDispatcher {
 	/**
 	/**
 	 * Returns the environment blend mode from the current XR session.
 	 * Returns the environment blend mode from the current XR session.
 	 *
 	 *
-	 * @return {?('opaque'|'additive'|'alpha-blend')} The environment blend mode. Returns `null` when used outside of a XR session.
+	 * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session.
 	 */
 	 */
 	getEnvironmentBlendMode() {
 	getEnvironmentBlendMode() {
 
 

+ 1 - 1
src/renderers/webxr/WebXRManager.js

@@ -498,7 +498,7 @@ class WebXRManager extends EventDispatcher {
 		/**
 		/**
 		 * Returns the environment blend mode from the current XR session.
 		 * Returns the environment blend mode from the current XR session.
 		 *
 		 *
-		 * @return {?('opaque'|'additive'|'alpha-blend')} The environment blend mode. Returns `null` when used outside of a XR session.
+		 * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session.
 		 */
 		 */
 		this.getEnvironmentBlendMode = function () {
 		this.getEnvironmentBlendMode = function () {
 
 

粤ICP备19079148号