Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/event-handler.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { EventHandle } from './event-handle.js';

/**
* Callback used by {@link EventHandler} functions. Note the callback is limited to 8 arguments.
*
* @callback HandleEventCallback
* Callback used by {@link EventHandler} functions. Note the callback is limited to 8 arguments.
* @param {any} [arg1] - First argument that is passed from caller.
* @param {any} [arg2] - Second argument that is passed from caller.
* @param {any} [arg3] - Third argument that is passed from caller.
Expand All @@ -12,6 +11,7 @@ import { EventHandle } from './event-handle.js';
* @param {any} [arg6] - Sixth argument that is passed from caller.
* @param {any} [arg7] - Seventh argument that is passed from caller.
* @param {any} [arg8] - Eighth argument that is passed from caller.
* @returns {void}
*/

/**
Expand Down
8 changes: 4 additions & 4 deletions src/core/wasm-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ class Impl {
}

/**
* Callback used by {@link Module#setConfig}.
*
* @callback ModuleErrorCallback
* Callback used by {@link WasmModule.setConfig}.
* @param {string} error - If the instance fails to load this will contain a description of the error.
* @returns {void}
*/

/**
* Callback used by {@link Module#getInstance}.
*
* @callback ModuleInstanceCallback
* Callback used by {@link WasmModule.getInstance}.
* @param {any} moduleInstance - The module instance.
* @returns {void}
*/

/**
Expand Down
12 changes: 1 addition & 11 deletions src/framework/anim/evaluator/anim-target.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/**
* Callback function that the {@link AnimEvaluator} uses to set final animation values. These
* callbacks are stored in {@link AnimTarget} instances which are constructed by an
* {@link AnimBinder}.
*
* @callback AnimSetter
* @param {number[]} value - Updated animation value.
* @ignore
*/

/**
* Stores the information required by {@link AnimEvaluator} for updating a target value.
*
Expand All @@ -17,7 +7,7 @@ class AnimTarget {
/**
* Create a new AnimTarget instance.
*
* @param {AnimSetter} func - This function will be called when a new animation value is output
* @param {(value: number[]) => void} func - This function will be called when a new animation value is output
* by the {@link AnimEvaluator}.
* @param {'vector'|'quaternion'} type - The type of animation data this target expects.
* @param {number} components - The number of components on this target (this should ideally
Expand Down
9 changes: 3 additions & 6 deletions src/framework/app-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,23 @@ import { getApplication, setApplication } from './globals.js';
*/

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

/**
* Callback used by {@link AppBase#preload} when all assets (marked as 'preload') are loaded.
*
* @callback PreloadAppCallback
* Callback used by {@link AppBase#preload} when all assets (marked as 'preload') are loaded.
* @returns {void}
*/

/**
* @callback MakeTickCallback
* Callback used by {@link AppBase#start} and itself to request the rendering of a new animation
* frame.
*
* @callback MakeTickCallback
* @param {number} [timestamp] - The timestamp supplied by requestAnimationFrame.
* @param {XRFrame} [frame] - XRFrame from requestAnimationFrame callback.
* @returns {void}
Expand Down
18 changes: 8 additions & 10 deletions src/framework/asset/asset-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,32 @@ import { standardMaterialTextureParameters } from '../../scene/materials/standar
import { Asset } from './asset.js';

/**
* @import { Bundle } from '../bundle/bundle.js'
* @import { BundleRegistry } from '../bundle/bundle-registry.js'
* @import { ResourceLoader } from '../handlers/loader.js'
*/

/**
* Callback used by {@link AssetRegistry#filter} to filter assets.
*
* @callback FilterAssetCallback
* Callback used by {@link AssetRegistry#filter} to filter assets.
* @param {Asset} asset - The current asset to filter.
* @returns {boolean} Return `true` to include asset to result list.
*/

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

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

/**
Expand Down Expand Up @@ -366,8 +364,8 @@ class AssetRegistry extends EventHandler {
* is already loaded is bypassed, which forces loading of asset regardless.
* @param {BundlesFilterCallback} [options.bundlesFilter] - A callback that will be called
* when loading an asset that is contained in any of the bundles. It provides an array of
* bundles and will ensure asset is loaded from bundle returned from a callback. By default
* smallest filesize bundle is chosen.
* bundles and will ensure asset is loaded from bundle returned from a callback. By default,
* the smallest filesize bundle is chosen.
* @example
* // load some assets
* const assetsToLoad = [
Expand Down
4 changes: 2 additions & 2 deletions src/framework/asset/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const VARIANT_SUPPORT = {
const VARIANT_DEFAULT_PRIORITY = ['pvr', 'dxt', 'etc2', 'etc1', 'basis'];

/**
* Callback used by {@link Asset#ready} and called when an asset is ready.
*
* @callback AssetReadyCallback
* Callback used by {@link Asset#ready} and called when an asset is ready.
* @param {Asset} asset - The ready asset.
* @returns {void}
*/

/**
Expand Down
7 changes: 4 additions & 3 deletions src/framework/components/camera/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import { PostEffectQueue } from './post-effect-queue.js';
*/

/**
* Callback used by {@link CameraComponent#calculateTransform} and {@link CameraComponent#calculateProjection}.
*
* @callback CalculateMatrixCallback
* Callback used by {@link CameraComponent#calculateTransform} and {@link CameraComponent#calculateProjection}.
* @param {Mat4} transformMatrix - Output of the function.
* @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.
* @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.
* @returns {void}
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/framework/handlers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/

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

/**
Expand Down
8 changes: 4 additions & 4 deletions src/framework/handlers/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { Debug } from '../../core/debug.js';
*/

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

/**
Expand Down Expand Up @@ -107,8 +107,8 @@ class ResourceLoader {
* from a bundle. Defaults to false.
* @param {BundlesFilterCallback} [options.bundlesFilter] - A callback that will be called
* when loading an asset that is contained in any of the bundles. It provides an array of
* bundles and will ensure asset is loaded from bundle returned from a callback. By default
* smallest filesize bundle is choosen.
* bundles and will ensure asset is loaded from bundle returned from a callback. By default,
* the smallest filesize bundle is chosen.
* @example
* app.loader.load("../path/to/texture.png", "texture", function (err, texture) {
* // use texture here
Expand Down
3 changes: 1 addition & 2 deletions src/framework/handlers/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { ResourceHandler } from './handler.js';
*/

/**
* Callback used by {@link ModelHandler#addParser} to decide on which parser to use.
*
* @callback AddParserCallback
* Callback used by {@link ModelHandler#addParser} to decide on which parser to use.
* @param {string} url - The resource url.
* @param {object} data - The raw model data.
* @returns {boolean} Return true if this parser should be used to parse the data into a
Expand Down
20 changes: 10 additions & 10 deletions src/framework/scene-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ import { SceneRegistryItem } from './scene-registry-item.js';
*/

/**
* Callback used by {@link SceneRegistry#loadSceneHierarchy}.
*
* @callback LoadHierarchyCallback
* Callback used by {@link SceneRegistry#loadSceneHierarchy}.
* @param {string|null} err - The error message in the case where the loading or parsing fails.
* @param {Entity} [entity] - The loaded root entity if no errors were encountered.
* @returns {void}
*/

/**
* Callback used by {@link SceneRegistry#loadSceneSettings}.
*
* @callback LoadSettingsCallback
* Callback used by {@link SceneRegistry#loadSceneSettings}.
* @param {string|null} err - The error message in the case where the loading or parsing fails.
* @returns {void}
*/

/**
* Callback used by {@link SceneRegistry#changeScene}.
*
* @callback ChangeSceneCallback
* Callback used by {@link SceneRegistry#changeScene}.
* @param {string|null} err - The error message in the case where the loading or parsing fails.
* @param {Entity} [entity] - The loaded root entity if no errors were encountered.
* @returns {void}
*/

/**
* Callback used by {@link SceneRegistry#loadScene}.
*
* @callback LoadSceneCallback
* Callback used by {@link SceneRegistry#loadScene}.
* @param {string|null} err - The error message in the case where the loading or parsing fails.
* @param {Entity} [entity] - The loaded root entity if no errors were encountered.
* @returns {void}
*/

/**
* Callback used by {@link SceneRegistry#loadSceneData}.
*
* @callback LoadSceneDataCallback
* Callback used by {@link SceneRegistry#loadSceneData}.
* @param {string|null} err - The error message in the case where the loading or parsing fails.
* @param {SceneRegistryItem} [sceneItem] - The scene registry item if no errors were encountered.
* @returns {void}
*/

/**
Expand Down
13 changes: 2 additions & 11 deletions src/framework/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@ import { getApplication } from './globals.js';
*/

/**
* Callback used by {@link script.createLoadingScreen}.
*
* @callback CreateScreenCallback
* Callback used by {@link script.createLoadingScreen}.
* @param {AppBase} app - The application.
*/

/**
* Callback used by {@link script.create}.
*
* @callback CreateScriptCallback
* @param {AppBase} app - The application.
* @returns {object} Return the Type of the script resource to be instanced for each Entity.
* @ignore
* @returns {void}
*/

// flag to avoid creating multiple loading screens e.g. when
Expand Down
15 changes: 8 additions & 7 deletions src/framework/xr/xr-anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ import { Quat } from '../../core/math/quat.js';
*/

/**
* Callback used by {@link XrAnchor#persist}.
*
* @callback XrAnchorPersistCallback
* Callback used by {@link XrAnchor#persist}.
* @param {Error|null} err - The Error object if failed to persist an anchor or null.
* @param {string|null} uuid - Unique string that can be used to restore {@link XrAnchor}
* in another session.
* @param {string|null} uuid - Unique string that can be used to restore an {@link XrAnchor} in
* another session.
* @returns {void}
*/

/**
* Callback used by {@link XrAnchor#forget}.
*
* @callback XrAnchorForgetCallback
* @param {Error|null} err - The Error object if failed to forget an anchor or null if succeeded.
* Callback used by {@link XrAnchor#forget}.
* @param {Error|null} err - The Error object if failed to forget an {@link XrAnchor} or null if
* succeeded.
* @returns {void}
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/framework/xr/xr-anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { XrAnchor } from './xr-anchor.js';
*/

/**
* Callback used by {@link XrAnchors#create}.
*
* @callback XrAnchorCreateCallback
* Callback used by {@link XrAnchors#create}.
* @param {Error|null} err - The Error object if failed to create an anchor or null.
* @param {XrAnchor|null} anchor - The anchor that is tracked against real world geometry.
* @returns {void}
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/framework/xr/xr-hit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { XrHitTestSource } from './xr-hit-test-source.js';
*/

/**
* Callback used by {@link XrHitTest#start} and {@link XrHitTest#startForInputSource}.
*
* @callback XrHitTestStartCallback
* Callback used by {@link XrHitTest#start} and {@link XrInputSource#hitTestStart}.
* @param {Error|null} err - The Error object if failed to create hit test source or null.
* @param {XrHitTestSource|null} hitTestSource - Object that provides access to hit results against
* real world geometry.
* @returns {void}
*/

/**
Expand Down
8 changes: 4 additions & 4 deletions src/framework/xr/xr-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import { XrViews } from './xr-views.js';
*/

/**
* Callback used by {@link XrManager#endXr} and {@link XrManager#startXr}.
*
* @callback XrErrorCallback
* Callback used by {@link XrManager#start} and {@link XrManager#end}.
* @param {Error|null} err - The Error object or null if operation was successful.
* @returns {void}
*/

/**
* Callback used by manual room capturing.
*
* @callback XrRoomCaptureCallback
* Callback used by manual room capturing.
* @param {Error|null} err - The Error object or null if manual room capture was successful.
* @returns {void}
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/platform/input/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { EventHandler } from '../../core/event-handler.js';
import { isMousePointerLocked, MouseEvent } from './mouse-event.js';

/**
* Callback used by {@link Mouse#enablePointerLock} and {@link Application#disablePointerLock}.
*
* @callback LockMouseCallback
* Callback used by {@link Mouse#enablePointerLock} and {@link Mouse#disablePointerLock}.
* @returns {void}
*/

/**
Expand Down
Loading