Skip to content

Commit e2fa4fe

Browse files
authored
[FIX] Restore callback descriptions (#7607)
* [FIX] Restore callback descriptions * Revert package-lock.json * Grammar tweak
1 parent 6a91953 commit e2fa4fe

File tree

20 files changed

+72
-94
lines changed

20 files changed

+72
-94
lines changed

src/core/event-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { EventHandle } from './event-handle.js';
22

33
/**
4-
* Callback used by {@link EventHandler} functions. Note the callback is limited to 8 arguments.
5-
*
64
* @callback HandleEventCallback
5+
* Callback used by {@link EventHandler} functions. Note the callback is limited to 8 arguments.
76
* @param {any} [arg1] - First argument that is passed from caller.
87
* @param {any} [arg2] - Second argument that is passed from caller.
98
* @param {any} [arg3] - Third argument that is passed from caller.
@@ -12,6 +11,7 @@ import { EventHandle } from './event-handle.js';
1211
* @param {any} [arg6] - Sixth argument that is passed from caller.
1312
* @param {any} [arg7] - Seventh argument that is passed from caller.
1413
* @param {any} [arg8] - Eighth argument that is passed from caller.
14+
* @returns {void}
1515
*/
1616

1717
/**

src/core/wasm-module.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ class Impl {
110110
}
111111

112112
/**
113-
* Callback used by {@link Module#setConfig}.
114-
*
115113
* @callback ModuleErrorCallback
114+
* Callback used by {@link WasmModule.setConfig}.
116115
* @param {string} error - If the instance fails to load this will contain a description of the error.
116+
* @returns {void}
117117
*/
118118

119119
/**
120-
* Callback used by {@link Module#getInstance}.
121-
*
122120
* @callback ModuleInstanceCallback
121+
* Callback used by {@link WasmModule.getInstance}.
123122
* @param {any} moduleInstance - The module instance.
123+
* @returns {void}
124124
*/
125125

126126
/**

src/framework/anim/evaluator/anim-target.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/**
2-
* Callback function that the {@link AnimEvaluator} uses to set final animation values. These
3-
* callbacks are stored in {@link AnimTarget} instances which are constructed by an
4-
* {@link AnimBinder}.
5-
*
6-
* @callback AnimSetter
7-
* @param {number[]} value - Updated animation value.
8-
* @ignore
9-
*/
10-
111
/**
122
* Stores the information required by {@link AnimEvaluator} for updating a target value.
133
*
@@ -17,7 +7,7 @@ class AnimTarget {
177
/**
188
* Create a new AnimTarget instance.
199
*
20-
* @param {AnimSetter} func - This function will be called when a new animation value is output
10+
* @param {(value: number[]) => void} func - This function will be called when a new animation value is output
2111
* by the {@link AnimEvaluator}.
2212
* @param {'vector'|'quaternion'} type - The type of animation data this target expects.
2313
* @param {number} components - The number of components on this target (this should ideally

src/framework/app-base.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,23 @@ import { getApplication, setApplication } from './globals.js';
7272
*/
7373

7474
/**
75+
* @callback ConfigureAppCallback
7576
* Callback used by {@link AppBase#configure} when configuration file is loaded and parsed (or an
7677
* error occurs).
77-
*
78-
* @callback ConfigureAppCallback
7978
* @param {string|null} err - The error message in the case where the loading or parsing fails.
8079
* @returns {void}
8180
*/
8281

8382
/**
84-
* Callback used by {@link AppBase#preload} when all assets (marked as 'preload') are loaded.
85-
*
8683
* @callback PreloadAppCallback
84+
* Callback used by {@link AppBase#preload} when all assets (marked as 'preload') are loaded.
8785
* @returns {void}
8886
*/
8987

9088
/**
89+
* @callback MakeTickCallback
9190
* Callback used by {@link AppBase#start} and itself to request the rendering of a new animation
9291
* frame.
93-
*
94-
* @callback MakeTickCallback
9592
* @param {number} [timestamp] - The timestamp supplied by requestAnimationFrame.
9693
* @param {XRFrame} [frame] - XRFrame from requestAnimationFrame callback.
9794
* @returns {void}

src/framework/asset/asset-registry.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,32 @@ import { standardMaterialTextureParameters } from '../../scene/materials/standar
66
import { Asset } from './asset.js';
77

88
/**
9-
* @import { Bundle } from '../bundle/bundle.js'
109
* @import { BundleRegistry } from '../bundle/bundle-registry.js'
1110
* @import { ResourceLoader } from '../handlers/loader.js'
1211
*/
1312

1413
/**
15-
* Callback used by {@link AssetRegistry#filter} to filter assets.
16-
*
1714
* @callback FilterAssetCallback
15+
* Callback used by {@link AssetRegistry#filter} to filter assets.
1816
* @param {Asset} asset - The current asset to filter.
1917
* @returns {boolean} Return `true` to include asset to result list.
2018
*/
2119

2220
/**
21+
* @callback LoadAssetCallback
2322
* Callback used by {@link AssetRegistry#loadFromUrl} and called when an asset is loaded (or an
2423
* error occurs).
25-
*
26-
* @callback LoadAssetCallback
2724
* @param {string|null} err - The error message is null if no errors were encountered.
2825
* @param {Asset} [asset] - The loaded asset if no errors were encountered.
26+
* @returns {void}
2927
*/
3028

3129
/**
30+
* @callback BundlesFilterCallback
3231
* Callback used by {@link ResourceLoader#load} and called when an asset is choosing a bundle
3332
* to load from. Return a single bundle to ensure asset is loaded from it.
34-
*
35-
* @callback BundlesFilterCallback
36-
* @param {Bundle[]} bundles - List of bundles which contain the asset.
33+
* @param {Asset[]} bundles - List of bundle assets which contain the asset.
34+
* @returns {Asset} Return a single bundle asset to ensure asset is loaded from it.
3735
*/
3836

3937
/**
@@ -366,8 +364,8 @@ class AssetRegistry extends EventHandler {
366364
* is already loaded is bypassed, which forces loading of asset regardless.
367365
* @param {BundlesFilterCallback} [options.bundlesFilter] - A callback that will be called
368366
* when loading an asset that is contained in any of the bundles. It provides an array of
369-
* bundles and will ensure asset is loaded from bundle returned from a callback. By default
370-
* smallest filesize bundle is chosen.
367+
* bundles and will ensure asset is loaded from bundle returned from a callback. By default,
368+
* the smallest filesize bundle is chosen.
371369
* @example
372370
* // load some assets
373371
* const assetsToLoad = [

src/framework/asset/asset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ const VARIANT_SUPPORT = {
2626
const VARIANT_DEFAULT_PRIORITY = ['pvr', 'dxt', 'etc2', 'etc1', 'basis'];
2727

2828
/**
29-
* Callback used by {@link Asset#ready} and called when an asset is ready.
30-
*
3129
* @callback AssetReadyCallback
30+
* Callback used by {@link Asset#ready} and called when an asset is ready.
3231
* @param {Asset} asset - The ready asset.
32+
* @returns {void}
3333
*/
3434

3535
/**

src/framework/components/camera/component.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ import { PostEffectQueue } from './post-effect-queue.js';
2323
*/
2424

2525
/**
26-
* Callback used by {@link CameraComponent#calculateTransform} and {@link CameraComponent#calculateProjection}.
27-
*
2826
* @callback CalculateMatrixCallback
27+
* Callback used by {@link CameraComponent#calculateTransform} and {@link CameraComponent#calculateProjection}.
2928
* @param {Mat4} transformMatrix - Output of the function.
30-
* @param {number} view - Type of view. Can be {@link VIEW_CENTER}, {@link VIEW_LEFT} or {@link VIEW_RIGHT}. Left and right are only used in stereo rendering.
29+
* @param {number} view - Type of view. Can be {@link VIEW_CENTER}, {@link VIEW_LEFT} or
30+
* {@link VIEW_RIGHT}. Left and right are only used in stereo rendering.
31+
* @returns {void}
3132
*/
3233

3334
/**

src/framework/handlers/handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
*/
66

77
/**
8-
* Callback used by {@link ResourceHandler#load} when a resource is loaded (or an error occurs).
9-
*
108
* @callback ResourceHandlerCallback
9+
* Callback used by {@link ResourceHandler#load} when a resource is loaded (or an error occurs).
1110
* @param {string|null} err - The error message in the case where the load fails.
1211
* @param {any} [response] - The raw data that has been successfully loaded.
12+
* @returns {void}
1313
*/
1414

1515
/**

src/framework/handlers/loader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { Debug } from '../../core/debug.js';
99
*/
1010

1111
/**
12-
* Callback used by {@link ResourceLoader#load} when a resource is loaded (or an error occurs).
13-
*
1412
* @callback ResourceLoaderCallback
13+
* Callback used by {@link ResourceLoader#load} when a resource is loaded (or an error occurs).
1514
* @param {string|null} err - The error message in the case where the load fails.
1615
* @param {any} [resource] - The resource that has been successfully loaded.
16+
* @returns {void}
1717
*/
1818

1919
/**
@@ -107,8 +107,8 @@ class ResourceLoader {
107107
* from a bundle. Defaults to false.
108108
* @param {BundlesFilterCallback} [options.bundlesFilter] - A callback that will be called
109109
* when loading an asset that is contained in any of the bundles. It provides an array of
110-
* bundles and will ensure asset is loaded from bundle returned from a callback. By default
111-
* smallest filesize bundle is choosen.
110+
* bundles and will ensure asset is loaded from bundle returned from a callback. By default,
111+
* the smallest filesize bundle is chosen.
112112
* @example
113113
* app.loader.load("../path/to/texture.png", "texture", function (err, texture) {
114114
* // use texture here

src/framework/handlers/model.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import { ResourceHandler } from './handler.js';
1010
*/
1111

1212
/**
13-
* Callback used by {@link ModelHandler#addParser} to decide on which parser to use.
14-
*
1513
* @callback AddParserCallback
14+
* Callback used by {@link ModelHandler#addParser} to decide on which parser to use.
1615
* @param {string} url - The resource url.
1716
* @param {object} data - The raw model data.
1817
* @returns {boolean} Return true if this parser should be used to parse the data into a

0 commit comments

Comments
 (0)