Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 7 additions & 7 deletions examples/jsm/controls/ArcballControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ class ArcballControls extends Controls {
*
* @param {'PAN'|'ROTATE'|'ZOOM'|'FOV'} operation - The operation to be performed ('PAN', 'ROTATE', 'ZOOM', 'FOV').
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
* @param {'CTRL'|'SHIFT'|null} [key=null] - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
* @param {?'CTRL'|'SHIFT'} [key=null] - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
* @returns {boolean} `true` if the mouse action has been successfully added, `false` otherwise.
*/
setMouseAction( operation, mouse, key = null ) {
Expand Down Expand Up @@ -1396,7 +1396,7 @@ class ArcballControls extends Controls {
* Remove a mouse action by specifying its mouse/key combination.
*
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
* @param {'CTRL'|'SHIFT'|null} key - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
* @param {?'CTRL'|'SHIFT'} key - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
* @returns {boolean} `true` if the operation has been successfully removed, `false` otherwise.
*/
unsetMouseAction( mouse, key = null ) {
Expand All @@ -1421,8 +1421,8 @@ class ArcballControls extends Controls {
*
* @private
* @param {0|1|2|'WHEEL'} mouse - Mouse button index (0, 1, 2) or 'WHEEL' for wheel notches.
* @param {'CTRL'|'SHIFT'|null} key - Keyboard modifier.
* @returns {'PAN'|'ROTATE'|'ZOOM'|'FOV'|null} The operation if it has been found, `null` otherwise.
* @param {?'CTRL'|'SHIFT'} key - Keyboard modifier.
* @returns {?'PAN'|'ROTATE'|'ZOOM'|'FOV'} The operation if it has been found, `null` otherwise.
*/
getOpFromAction( mouse, key ) {

Expand Down Expand Up @@ -1463,7 +1463,7 @@ class ArcballControls extends Controls {
*
* @private
* @param {0|1|2} mouse - Mouse button index (0, 1, 2)
* @param {'CTRL'|'SHIFT'|null} key - Keyboard modifier
* @param {?'CTRL'|'SHIFT'} key - Keyboard modifier
* @returns {?STATE} The FSA state obtained from the operation associated to mouse/keyboard combination.
*/
getOpStateFromAction( mouse, key ) {
Expand Down Expand Up @@ -2509,8 +2509,8 @@ class ArcballControls extends Controls {
* Sets values in transformation object.
*
* @private
* @param {Matrix4} [camera=null] - Transformation to be applied to the camera.
* @param {Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
* @param {?Matrix4} [camera=null] - Transformation to be applied to the camera.
* @param {?Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
*/
setTransformationMatrices( camera = null, gizmos = null ) {

Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ class GLTFWriter {
/**
* Process material
* @param {THREE.Material} material Material to process
* @return {Promise<number|null>} Index of the processed material in the "materials" array
* @return {Promise<?number>} Index of the processed material in the "materials" array
*/
async processMaterialAsync( material ) {

Expand Down Expand Up @@ -1735,7 +1735,7 @@ class GLTFWriter {
/**
* Process mesh
* @param {THREE.Mesh} mesh Mesh to process
* @return {Promise<number|null>} Index of the processed mesh in the "meshes" array
* @return {Promise<?number>} Index of the processed mesh in the "meshes" array
*/
async processMeshAsync( mesh ) {

Expand Down Expand Up @@ -2189,7 +2189,7 @@ class GLTFWriter {
*
* @param {THREE.AnimationClip} clip
* @param {THREE.Object3D} root
* @return {number|null}
* @return {?number}
*/
processAnimation( clip, root ) {

Expand Down Expand Up @@ -2299,7 +2299,7 @@ class GLTFWriter {

/**
* @param {THREE.Object3D} object
* @return {number|null}
* @return {?number}
*/
processSkin( object ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/ColladaLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ColladaLoader extends Loader {
*
* @param {string} text - The raw Collada data as a string.
* @param {string} path - The asset path.
* @return {{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
* @return {?{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
*/
parse( text, path ) {

Expand Down
6 changes: 3 additions & 3 deletions examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2943,7 +2943,7 @@ class GLTFParser {
* @private
* @param {string} type
* @param {number} index
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
* @return {Promise<Object3D|Material|Texture|AnimationClip|ArrayBuffer|Object>}
*/
getDependency( type, index ) {

Expand Down Expand Up @@ -3283,7 +3283,7 @@ class GLTFParser {
*
* @private
* @param {number} textureIndex
* @return {Promise<THREE.Texture|null>}
* @return {Promise<?Texture>}
*/
loadTexture( textureIndex ) {

Expand Down Expand Up @@ -4020,7 +4020,7 @@ class GLTFParser {
*
* @private
* @param {number} cameraIndex
* @return {Promise<THREE.Camera>}
* @return {Promise<Camera>|undefined}
*/
loadCamera( cameraIndex ) {

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/math/ConvexHull.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class ConvexHull {
*
* @param {Ray} ray - The ray to test.
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {Vector3|null} The intersection point. Returns `null` if not intersection was detected.
* @return {?Vector3} The intersection point. Returns `null` if not intersection was detected.
*/
intersectRay( ray, target ) {

Expand Down Expand Up @@ -1298,7 +1298,7 @@ class HalfEdge {
* Returns the origin vertex.
*
* @private
* @return {VertexNode} The destination vertex.
* @return {?VertexNode} The destination vertex.
*/
tail() {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/misc/MD2CharacterComplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class MD2CharacterComplex {
/**
* The movement controls.
*
* @type {Object}
* @type {?Object}
* @default null
*/
this.controls = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/misc/ProgressiveLightMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class ProgressiveLightMap {
*
* @private
* @param {number} res - The square resolution of this object's lightMap.
* @param {WebGLRenderTarget} [lightMap] - The lightmap to initialize the plane with.
* @param {?WebGLRenderTarget} [lightMap] - The lightmap to initialize the plane with.
*/
_initializeBlurPlane( res, lightMap = null ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/tsl/display/ChromaticAberrationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default ChromaticAberrationNode;
* @function
* @param {Node<vec4>} node - The node that represents the input of the effect.
* @param {Node|number} [strength=1.0] - The strength of the chromatic aberration effect as a node or value.
* @param {Node|Vector2} [center=null] - The center point of the effect as a node or value. If null, uses screen center (0.5, 0.5).
* @param {?Node|Vector2} [center=null] - The center point of the effect as a node or value. If null, uses screen center (0.5, 0.5).
* @param {Node|number} [scale=1.1] - The scale factor for stepped scaling from center as a node or value.
* @returns {ChromaticAberrationNode}
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/utils/BufferGeometryUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function deepCloneAttribute( attribute ) {
* single {@link InterleavedBuffer} instance. All attributes must have compatible types.
*
* @param {Array<BufferAttribute>} attributes - The attributes to interleave.
* @return {Array<InterleavedBufferAttribute>} An array of interleaved attributes. If interleave does not succeed, the method returns `null`.
* @return {?Array<InterleavedBufferAttribute>} An array of interleaved attributes. If interleave does not succeed, the method returns `null`.
*/
function interleaveAttributes( attributes ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/webxr/OculusHandModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class OculusHandModel extends Object3D {
/**
* Returns the pointer position which is the position of the index finger tip.
*
* @return {Vector3|null} The pointer position. Returns `null` if not index finger tip joint was found.
* @return {?Vector3} The pointer position. Returns `null` if not index finger tip joint was found.
*/
getPointerPosition() {

Expand Down
4 changes: 2 additions & 2 deletions src/core/BufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ class BufferGeometry extends EventDispatcher {
/**
* Bounding box for the geometry which can be calculated with `computeBoundingBox()`.
*
* @type {Box3}
* @type {?Box3}
* @default null
*/
this.boundingBox = null;

/**
* Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`.
*
* @type {Sphere}
* @type {?Sphere}
* @default null
*/
this.boundingSphere = null;
Expand Down
2 changes: 1 addition & 1 deletion src/lights/webgpu/ProjectorLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ProjectorLight extends SpotLight {
/**
* Aspect ratio of the light. Set to `null` to use the texture aspect ratio.
*
* @type {number}
* @type {?number}
* @default null
*/
this.aspect = null;
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/accessors/Object3DNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Object3DNode extends Node {
/**
* Overwritten since the node type is inferred from the scope.
*
* @return {string} The node type.
* @return {('mat4'|'vec3'|'float')} The node type.
*/
getNodeType() {

Expand Down
8 changes: 4 additions & 4 deletions src/nodes/core/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class Node extends EventDispatcher {
* This state builds the output node and returns the resulting shader string.
*
* @param {NodeBuilder} builder - The current node builder.
* @param {?string} output - Can be used to define the output type.
* @param {?string} [output] - Can be used to define the output type.
* @return {?string} The generated shader string.
*/
generate( builder, output ) {
Expand Down Expand Up @@ -613,8 +613,8 @@ class Node extends EventDispatcher {
* - **generate**: Generates the shader code for the node. Returns the generated shader string.
*
* @param {NodeBuilder} builder - The current node builder.
* @param {string|Node|null} [output=null] - Can be used to define the output type.
* @return {Node|string|null} The result of the build process, depending on the build stage.
* @param {?string|Node} [output=null] - Can be used to define the output type.
* @return {?Node|string} The result of the build process, depending on the build stage.
*/
build( builder, output = null ) {

Expand Down Expand Up @@ -773,7 +773,7 @@ class Node extends EventDispatcher {
/**
* Returns the child nodes as a JSON object.
*
* @return {Array<Object>} An iterable list of serialized child objects as JSON.
* @return {Generator<Object>} An iterable list of serialized child objects as JSON.
*/
getSerializeChildren() {

Expand Down
6 changes: 3 additions & 3 deletions src/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2260,8 +2260,8 @@ class NodeBuilder {
*
* @param {Node} node - The node to execute.
* @param {string} buildStage - The build stage to execute the node in.
* @param {Node|string|null} output - Expected output type. For example 'vec3'.
* @return {Node|string|null} The result of the node build.
* @param {?Node|string} [output=null] - Expected output type. For example 'vec3'.
* @return {?Node|string} The result of the node build.
*/
flowBuildStage( node, buildStage, output = null ) {

Expand Down Expand Up @@ -2387,7 +2387,7 @@ class NodeBuilder {
* @param {Node} node - The node to execute.
* @param {?string} output - Expected output type. For example 'vec3'.
* @param {?string} propertyName - The property name to assign the result.
* @return {Object|Node|null} The code flow or node.build() result.
* @return {?Object|Node} The code flow or node.build() result.
*/
flowNodeFromShaderStage( shaderStage, node, output = null, propertyName = null ) {

Expand Down
4 changes: 2 additions & 2 deletions src/nodes/core/SubBuildNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { nodeObject } from '../tsl/TSLCore.js';
* @augments Node
* @param {Node} node - The node to be built in the sub-build.
* @param {string} name - The name of the sub-build.
* @param {string|null} [nodeType=null] - The type of the node, if known.
* @param {?string} [nodeType=null] - The type of the node, if known.
*/
class SubBuildNode extends Node {

Expand Down Expand Up @@ -83,7 +83,7 @@ export default SubBuildNode;
* @function
* @param {Node} node - The node to be built in the sub-build.
* @param {string} name - The name of the sub-build.
* @param {string|null} [type=null] - The type of the node, if known.
* @param {?string} [type=null] - The type of the node, if known.
* @returns {Node} A node object wrapping the SubBuildNode instance.
*/
export const subBuild = ( node, name, type = null ) => nodeObject( new SubBuildNode( nodeObject( node ), name, type ) );
2 changes: 1 addition & 1 deletion src/nodes/display/ScreenNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ScreenNode extends Node {
/**
* This method is overwritten since the node type depends on the selected scope.
*
* @return {('vec2'|'vec4')} The node type.
* @return {('float'|'vec2'|'vec4')} The node type.
*/
getNodeType() {

Expand Down
4 changes: 2 additions & 2 deletions src/objects/BatchedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ class BatchedMesh extends Mesh {
*
* @param {number} geometryId - The ID of the geometry to return the bounding box for.
* @param {Box3} target - The target object that is used to store the method's result.
* @return {Box3|null} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
* @return {?Box3} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
*/
getBoundingBoxAt( geometryId, target ) {

Expand Down Expand Up @@ -1016,7 +1016,7 @@ class BatchedMesh extends Mesh {
*
* @param {number} geometryId - The ID of the geometry to return the bounding sphere for.
* @param {Sphere} target - The target object that is used to store the method's result.
* @return {Sphere|null} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
* @return {?Sphere} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
*/
getBoundingSphereAt( geometryId, target ) {

Expand Down
2 changes: 1 addition & 1 deletion src/objects/LOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class LOD extends Object3D {
* the given distance.
*
* @param {number} distance - The LOD distance.
* @return {Object3D|null} The found 3D object. `null` if no 3D object has been found.
* @return {?Object3D} The found 3D object. `null` if no 3D object has been found.
*/
getObjectForDistance( distance ) {

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/common/Attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Attributes extends DataMap {
* Deletes the data for the given attribute.
*
* @param {BufferAttribute} attribute - The attribute.
* @return {Object|null} The deleted attribute data.
* @return {?Object} The deleted attribute data.
*/
delete( attribute ) {

Expand Down
4 changes: 2 additions & 2 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ class Renderer {
* if the renderer has been initialized.
*
* @param {Node|Array<Node>} computeNodes - The compute node(s).
* @param {Array<number>|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
* @param {?Array<number>|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
* @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
*/
compute( computeNodes, dispatchSizeOrCount = null ) {
Expand Down Expand Up @@ -2426,7 +2426,7 @@ class Renderer {
*
* @async
* @param {Node|Array<Node>} computeNodes - The compute node(s).
* @param {Array<number>|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
* @param {?Array<number>|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
* @return {Promise} A Promise that resolve when the compute has finished.
*/
async computeAsync( computeNodes, dispatchSizeOrCount = null ) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/common/SampledTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let _id = 0;
* Represents a sampled texture binding type.
*
* @private
* @augments Binding
* @augments Sampler
*/
class SampledTexture extends Sampler {

Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl-fallback/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class WebGLBackend extends Backend {
* the WebXR device API.
*
* @private
* @type {WebGLFramebuffer}
* @type {?WebGLFramebuffer}
* @default null
*/
this._xrFramebuffer = null;
Expand Down Expand Up @@ -817,7 +817,7 @@ class WebGLBackend extends Backend {
* @param {Node} computeNode - The compute node.
* @param {Array<BindGroup>} bindings - The bindings.
* @param {ComputePipeline} pipeline - The compute pipeline.
* @param {number|null} [count=null] - The count of compute invocations. If `null`, the count is determined by the compute node.
* @param {?number} [count=null] - The count of compute invocations. If `null`, the count is determined by the compute node.
*/
compute( computeGroup, computeNode, bindings, pipeline, count = null ) {

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgl-fallback/utils/WebGLState.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ class WebGLState {
* Sets the vertex state by binding the given VAO and element buffer.
*
* @param {WebGLVertexArrayObject} vao - The VAO.
* @param {WebGLBuffer} indexBuffer - The index buffer.
* @param {?WebGLBuffer} indexBuffer - The index buffer.
* @return {boolean} Whether a vertex state has been changed or not.
*/
setVertexState( vao, indexBuffer = null ) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgpu/WebGPUBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ class WebGPUBackend extends Backend {
* @param {Node} computeNode - The compute node.
* @param {Array<BindGroup>} bindings - The bindings.
* @param {ComputePipeline} pipeline - The compute pipeline.
* @param {Array<number>|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
* @param {?Array<number>|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
*/
compute( computeGroup, computeNode, bindings, pipeline, dispatchSizeOrCount = null ) {

Expand Down
Loading