Ver Fonte

Docs: Fix some typing (#30626)

Co-authored-by: Samuel Rigaud <srigaud@duodisplay.com>
Samuel Rigaud há 1 ano atrás
pai
commit
1eabccd84b

+ 1 - 1
src/animation/AnimationClip.js

@@ -289,7 +289,7 @@ class AnimationClip {
 	 * @static
 	 * @param {Object} animation - A serialized animation clip as JSON.
 	 * @param {Array<Bones>} bones - An array of bones.
-	 * @return {AnimationClip} The new animation clip.
+	 * @return {?AnimationClip} The new animation clip.
 	 */
 	static parseAnimation( animation, bones ) {
 

+ 1 - 1
src/animation/AnimationMixer.js

@@ -546,7 +546,7 @@ class AnimationMixer extends EventDispatcher {
 	 * @param {AnimationClip|string} clip - An animaion clip or alternatively the name of the animation clip.
 	 * @param {Object3D} [optionalRoot] - An alternative root object.
 	 * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode.
-	 * @return {AnimationAction} The animation action.
+	 * @return {?AnimationAction} The animation action.
 	 */
 	clipAction( clip, optionalRoot, blendMode ) {
 

+ 1 - 1
src/animation/PropertyBinding.js

@@ -119,7 +119,7 @@ class PropertyBinding {
 		/**
 		 * The object path to the animated property.
 		 *
-		 * @type {PropertyBinding}
+		 * @type {string}
 		 */
 		this.path = path;
 

+ 1 - 1
src/audio/AudioAnalyser.js

@@ -31,7 +31,7 @@ class AudioAnalyser {
 	 * Constructs a new audio analyzer.
 	 *
 	 * @param {Audio} audio - The audio to analyze.
-	 * @param {Audio} [fftSize=2048] - The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data.
+	 * @param {number} [fftSize=2048] - The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data.
 	 */
 	constructor( audio, fftSize = 2048 ) {
 

+ 2 - 2
src/audio/AudioListener.js

@@ -50,7 +50,7 @@ class AudioListener extends Object3D {
 		/**
 		 * An optional filter.
 		 *
-		 * Defined via {@AudioListener#setFilter}.
+		 * Defined via {@link AudioListener#setFilter}.
 		 *
 		 * @type {?AudioNode}
 		 * @default null
@@ -109,7 +109,7 @@ class AudioListener extends Object3D {
 	/**
 	 * Returns the current set filter.
 	 *
-	 * @return {AudioNode} The filter.
+	 * @return {?AudioNode} The filter.
 	 */
 	getFilter() {
 

+ 5 - 5
src/audio/PositionalAudio.js

@@ -104,7 +104,7 @@ class PositionalAudio extends Audio {
 	 * starts taking effect.
 	 *
 	 * @param {number} value - The reference distance to set.
-	 * @return {Audio} A reference to this instance.
+	 * @return {PositionalAudio} A reference to this instance.
 	 */
 	setRefDistance( value ) {
 
@@ -129,7 +129,7 @@ class PositionalAudio extends Audio {
 	 * Defines how quickly the volume is reduced as the source moves away from the listener.
 	 *
 	 * @param {number} value - The rolloff factor.
-	 * @return {Audio} A reference to this instance.
+	 * @return {PositionalAudio} A reference to this instance.
 	 */
 	setRolloffFactor( value ) {
 
@@ -158,7 +158,7 @@ class PositionalAudio extends Audio {
 	 * for more details.
 	 *
 	 * @param {('linear'|'inverse'|'exponential')} value - The distance model to set.
-	 * @return {Audio} A reference to this instance.
+	 * @return {PositionalAudio} A reference to this instance.
 	 */
 	setDistanceModel( value ) {
 
@@ -186,7 +186,7 @@ class PositionalAudio extends Audio {
 	 * This value is used only by the `linear` distance model.
 	 *
 	 * @param {number} value - The max distance.
-	 * @return {Audio} A reference to this instance.
+	 * @return {PositionalAudio} A reference to this instance.
 	 */
 	setMaxDistance( value ) {
 
@@ -202,7 +202,7 @@ class PositionalAudio extends Audio {
 	 * @param {number} coneInnerAngle - An angle, in degrees, of a cone inside of which there will be no volume reduction.
 	 * @param {number} coneOuterAngle - An angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the `coneOuterGain` parameter.
 	 * @param {number} coneOuterGain - The amount of volume reduction outside the cone defined by the `coneOuterAngle`. When set to `0`, no sound can be heard.
-	 * @return {Audio} A reference to this instance.
+	 * @return {PositionalAudio} A reference to this instance.
 	 */
 	setDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) {
 

+ 1 - 1
src/extras/core/Path.js

@@ -240,7 +240,7 @@ class Path extends CurvePath {
 	 * @param {number} aStartAngle - The start angle in radians.
 	 * @param {number} aEndAngle - The end angle in radians.
 	 * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
-	 * @param {boolean} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
+	 * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
 	 * @return {Path} A reference to this path.
 	 */
 	ellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {

+ 2 - 2
src/geometries/ConeGeometry.js

@@ -22,8 +22,8 @@ class ConeGeometry extends CylinderGeometry {
 	 * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cone.
 	 * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cone.
 	 * @param {boolean} [openEnded=false] - Whether the base of the cone is open or capped.
-	 * @param {boolean} [thetaStart=0] - Start angle for first segment, in radians.
-	 * @param {boolean} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.
+	 * @param {number} [thetaStart=0] - Start angle for first segment, in radians.
+	 * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.
 	 * The default value results in a complete cone.
 	 */
 	constructor( radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {

+ 2 - 2
src/geometries/CylinderGeometry.js

@@ -26,8 +26,8 @@ class CylinderGeometry extends BufferGeometry {
 	 * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cylinder.
 	 * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cylinder.
 	 * @param {boolean} [openEnded=false] - Whether the base of the cylinder is open or capped.
-	 * @param {boolean} [thetaStart=0] - Start angle for first segment, in radians.
-	 * @param {boolean} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.
+	 * @param {number} [thetaStart=0] - Start angle for first segment, in radians.
+	 * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.
 	 * The default value results in a complete cylinder.
 	 */
 	constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {

+ 1 - 1
src/geometries/ExtrudeGeometry.js

@@ -64,7 +64,7 @@ class ExtrudeGeometry extends BufferGeometry {
 	 * @param {number} [options.bevelSize=bevelThickness-0.1] - Distance from the shape outline that the bevel extends.
 	 * @param {number} [options.bevelOffset=0] - Distance from the shape outline that the bevel starts.
 	 * @param {number} [options.bevelSegments=3] - Number of bevel layers.
-	 * @param {Curve} [options.extrudePath=3] - A 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion.
+	 * @param {?Curve} [options.extrudePath=null] - A 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion.
 	 * @param {Object} [options.UVGenerator] - An object that provides UV generator functions for custom UV generation.
 	 */
 	constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {

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

@@ -13,7 +13,7 @@ class NodeLoader extends Loader {
 	/**
 	 * Constructs a new node loader.
 	 *
-	 * @param {?LoadingManager} manager - A reference to a loading manager.
+	 * @param {LoadingManager} [manager] - A reference to a loading manager.
 	 */
 	constructor( manager ) {
 

+ 1 - 1
src/loaders/nodes/NodeMaterialLoader.js

@@ -10,7 +10,7 @@ class NodeMaterialLoader extends MaterialLoader {
 	/**
 	 * Constructs a new node material loader.
 	 *
-	 * @param {?LoadingManager} manager - A reference to a loading manager.
+	 * @param {LoadingManager} [manager] - A reference to a loading manager.
 	 */
 	constructor( manager ) {
 

+ 3 - 3
src/loaders/nodes/NodeObjectLoader.js

@@ -14,7 +14,7 @@ class NodeObjectLoader extends ObjectLoader {
 	/**
 	 * Constructs a new node object loader.
 	 *
-	 * @param {?LoadingManager} manager - A reference to a loading manager.
+	 * @param {LoadingManager} [manager] - A reference to a loading manager.
 	 */
 	constructor( manager ) {
 
@@ -48,7 +48,7 @@ class NodeObjectLoader extends ObjectLoader {
 	 * Defines the dictionary of node types.
 	 *
 	 * @param {Object<string,Node.constructor>} value - The node library defined as `<classname,class>`.
-	 * @return {NodeLoader} A reference to this loader.
+	 * @return {NodeObjectLoader} A reference to this loader.
 	 */
 	setNodes( value ) {
 
@@ -61,7 +61,7 @@ class NodeObjectLoader extends ObjectLoader {
 	 * Defines the dictionary of node material types.
 	 *
 	 * @param {Object<string,NodeMaterial.constructor>} value - The node material library defined as `<classname,class>`.
-	 * @return {NodeLoader} A reference to this loader.
+	 * @return {NodeObjectLoader} A reference to this loader.
 	 */
 	setNodeMaterials( value ) {
 

粤ICP备19079148号