Преглед на файлове

Docs: fix some types (#30723)

Co-authored-by: Samuel Rigaud <srigaud@duodisplay.com>
Samuel Rigaud преди 11 месеца
родител
ревизия
c423179854

+ 1 - 1
examples/jsm/helpers/ViewHelper.js

@@ -181,7 +181,7 @@ class ViewHelper extends Object3D {
 		 * This method should be called when a click or pointer event
 		 * has happened in the app.
 		 *
-		 * @param {Event} event - The event to process.
+		 * @param {PointerEvent} event - The event to process.
 		 * @return {boolean} Whether an intersection with the helper has been detected or not.
 		 */
 		this.handleClick = function ( event ) {

+ 3 - 3
examples/jsm/loaders/MD2Loader.js

@@ -124,9 +124,9 @@ class MD2Loader extends Loader {
 	 * to the `onLoad()` callback.
 	 *
 	 * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
-	 * @param {function({scene:Group})} onLoad - Executed when the loading process has been finished.
-	 * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
-	 * @param {onErrorCallback} onError - Executed when errors occur.
+	 * @param {function(BufferGeometry)} onLoad - Executed when the loading process has been finished.
+	 * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
+	 * @param {onErrorCallback} [onError] - Executed when errors occur.
 	 */
 	load( url, onLoad, onProgress, onError ) {
 

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

@@ -303,7 +303,7 @@ class UltraHDRLoader extends Loader {
 	 * to the `onLoad()` callback.
 	 *
 	 * @param {string} url - The path/URL of the files to be loaded. This can also be a data URI.
-	 * @param {function(DataTexture)} onLoad - Executed when the loading process has been finished.
+	 * @param {function(DataTexture, Object)} onLoad - Executed when the loading process has been finished.
 	 * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
 	 * @param {onErrorCallback} onError - Executed when errors occur.
 	 * @return {DataTexture} The Ultra HDR texture.

+ 1 - 1
examples/jsm/utils/ShadowMapViewer.js

@@ -140,7 +140,7 @@ class ShadowMapViewer {
 		 * The position of the viewer. When changing this property, make sure
 		 * to call {@link ShadowMapViewer#update}.
 		 *
-		 * @type {{width:number,height:number}}
+		 * @type {{x:number,y:number, set:function(number,number)}}
 		 * @default true
 		 */
 		this.position = {

+ 1 - 1
examples/jsm/webxr/OculusHandPointerModel.js

@@ -90,7 +90,7 @@ class OculusHandPointerModel extends Object3D {
 		/**
 		 * Whether the model is attached or not.
 		 *
-		 * @type {?boolean}
+		 * @type {boolean}
 		 * @default false
 		 */
 		this.attached = false;

+ 1 - 1
examples/jsm/webxr/XRHandMeshModel.js

@@ -14,7 +14,7 @@ class XRHandMeshModel {
 	 *
 	 * @param {XRHandModel} handModel - The hand model.
 	 * @param {Group} controller - The WebXR controller.
-	 * @param {string} path - The model path.
+	 * @param {?string} path - The model path.
 	 * @param {XRHandedness} handedness - The handedness of the XR input source.
 	 * @param {?Loader} [loader=null] - The loader. If not provided, an instance of `GLTFLoader` will be used to load models.
 	 * @param {?Function} [onLoad=null] - A callback that is executed when a controller model has been loaded.

+ 2 - 2
src/loaders/FileLoader.js

@@ -62,8 +62,8 @@ class FileLoader extends Loader {
 	 *
 	 * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
 	 * @param {function(any)} onLoad - Executed when the loading process has been finished.
-	 * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
-	 * @param {onErrorCallback} onError - Executed when errors occur.
+	 * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
+	 * @param {onErrorCallback} [onError] - Executed when errors occur.
 	 * @return {any|undefined} The cached resource if available.
 	 */
 	load( url, onLoad, onProgress, onError ) {

+ 4 - 4
src/loaders/Loader.js

@@ -57,7 +57,7 @@ class Loader {
 		 * The [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}
 		 * used in HTTP request.
 		 *
-		 * @type {Object}
+		 * @type {Object<string, any>}
 		 */
 		this.requestHeader = {};
 
@@ -69,8 +69,8 @@ class Loader {
 	 *
 	 * @param {string} url - The path/URL of the file to be loaded.
 	 * @param {Function} onLoad - Executed when the loading process has been finished.
-	 * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
-	 * @param {onErrorCallback} onError - Executed when errors occur.
+	 * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
+	 * @param {onErrorCallback} [onError] - Executed when errors occur.
 	 */
 	load( /* url, onLoad, onProgress, onError */ ) {}
 
@@ -78,7 +78,7 @@ class Loader {
 	 * A async version of {@link Loader#load}.
 	 *
 	 * @param {string} url - The path/URL of the file to be loaded.
-	 * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
+	 * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
 	 * @return {Promise} A Promise that resolves when the asset has been loaded.
 	 */
 	loadAsync( url, onProgress ) {

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

@@ -33,7 +33,7 @@ class Color4 extends Color {
 	 * You can also pass a single THREE.Color, hex or
 	 * string argument to this method.
 	 *
-	 * @param {number|string} r - The red value.
+	 * @param {number|string|Color} r - The red value.
 	 * @param {number} g - The green value.
 	 * @param {number} b - The blue value.
 	 * @param {number} [a=1] - The alpha value.

+ 2 - 2
src/renderers/common/Renderer.js

@@ -2205,7 +2205,7 @@ class Renderer {
 	 * if the renderer has been initialized.
 	 *
 	 * @param {Node|Array<Node>} computeNodes - The compute node(s).
-	 * @return {?Promise} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
+	 * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
 	 */
 	compute( computeNodes ) {
 
@@ -2932,7 +2932,7 @@ class Renderer {
 	 * @param {Object3D} scene - The scene or 3D object to precompile.
 	 * @param {Camera} camera - The camera that is used to render the scene.
 	 * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
-	 * @return {Promise} A Promise that resolves when the compile has been finished.
+	 * @return {function(Object3D, Camera, ?Scene): Promise|undefined} A Promise that resolves when the compile has been finished.
 	 */
 	get compile() {
 

粤ICP备19079148号