Skip to content

Commit d47d1d8

Browse files
s-rigaudSamuel Rigaud
andauthored
Docs: fix null params (#31742)
* docs: fix null params * fix all nullable unions --------- Co-authored-by: Samuel Rigaud <[email protected]>
1 parent 4fdb25f commit d47d1d8

28 files changed

+52
-52
lines changed

examples/jsm/controls/ArcballControls.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ class ArcballControls extends Controls {
13151315
*
13161316
* @param {'PAN'|'ROTATE'|'ZOOM'|'FOV'} operation - The operation to be performed ('PAN', 'ROTATE', 'ZOOM', 'FOV').
13171317
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
1318-
* @param {'CTRL'|'SHIFT'|null} [key=null] - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
1318+
* @param {?('CTRL'|'SHIFT')} [key=null] - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
13191319
* @returns {boolean} `true` if the mouse action has been successfully added, `false` otherwise.
13201320
*/
13211321
setMouseAction( operation, mouse, key = null ) {
@@ -1396,7 +1396,7 @@ class ArcballControls extends Controls {
13961396
* Remove a mouse action by specifying its mouse/key combination.
13971397
*
13981398
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
1399-
* @param {'CTRL'|'SHIFT'|null} key - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
1399+
* @param {?('CTRL'|'SHIFT')} key - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
14001400
* @returns {boolean} `true` if the operation has been successfully removed, `false` otherwise.
14011401
*/
14021402
unsetMouseAction( mouse, key = null ) {
@@ -1421,8 +1421,8 @@ class ArcballControls extends Controls {
14211421
*
14221422
* @private
14231423
* @param {0|1|2|'WHEEL'} mouse - Mouse button index (0, 1, 2) or 'WHEEL' for wheel notches.
1424-
* @param {'CTRL'|'SHIFT'|null} key - Keyboard modifier.
1425-
* @returns {'PAN'|'ROTATE'|'ZOOM'|'FOV'|null} The operation if it has been found, `null` otherwise.
1424+
* @param {?('CTRL'|'SHIFT')} key - Keyboard modifier.
1425+
* @returns {?('PAN'|'ROTATE'|'ZOOM'|'FOV')} The operation if it has been found, `null` otherwise.
14261426
*/
14271427
getOpFromAction( mouse, key ) {
14281428

@@ -1463,7 +1463,7 @@ class ArcballControls extends Controls {
14631463
*
14641464
* @private
14651465
* @param {0|1|2} mouse - Mouse button index (0, 1, 2)
1466-
* @param {'CTRL'|'SHIFT'|null} key - Keyboard modifier
1466+
* @param {?('CTRL'|'SHIFT')} key - Keyboard modifier
14671467
* @returns {?STATE} The FSA state obtained from the operation associated to mouse/keyboard combination.
14681468
*/
14691469
getOpStateFromAction( mouse, key ) {
@@ -2509,8 +2509,8 @@ class ArcballControls extends Controls {
25092509
* Sets values in transformation object.
25102510
*
25112511
* @private
2512-
* @param {Matrix4} [camera=null] - Transformation to be applied to the camera.
2513-
* @param {Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
2512+
* @param {?Matrix4} [camera=null] - Transformation to be applied to the camera.
2513+
* @param {?Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
25142514
*/
25152515
setTransformationMatrices( camera = null, gizmos = null ) {
25162516

examples/jsm/exporters/GLTFExporter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ class GLTFWriter {
15591559
/**
15601560
* Process material
15611561
* @param {THREE.Material} material Material to process
1562-
* @return {Promise<number|null>} Index of the processed material in the "materials" array
1562+
* @return {Promise<?number>} Index of the processed material in the "materials" array
15631563
*/
15641564
async processMaterialAsync( material ) {
15651565

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

@@ -2189,7 +2189,7 @@ class GLTFWriter {
21892189
*
21902190
* @param {THREE.AnimationClip} clip
21912191
* @param {THREE.Object3D} root
2192-
* @return {number|null}
2192+
* @return {?number}
21932193
*/
21942194
processAnimation( clip, root ) {
21952195

@@ -2299,7 +2299,7 @@ class GLTFWriter {
22992299

23002300
/**
23012301
* @param {THREE.Object3D} object
2302-
* @return {number|null}
2302+
* @return {?number}
23032303
*/
23042304
processSkin( object ) {
23052305

examples/jsm/exporters/PLYExporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PLYExporter {
3131
* @param {Object3D} object - The 3D object to export.
3232
* @param {PLYExporter~OnDone} onDone - A callback function that is executed when the export has finished.
3333
* @param {PLYExporter~Options} options - The export options.
34-
* @return {?string|ArrayBuffer} The exported PLY.
34+
* @return {?(string|ArrayBuffer)} The exported PLY.
3535
*/
3636
parse( object, onDone, options = {} ) {
3737

examples/jsm/loaders/ColladaLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class ColladaLoader extends Loader {
113113
*
114114
* @param {string} text - The raw Collada data as a string.
115115
* @param {string} path - The asset path.
116-
* @return {{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
116+
* @return {?{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
117117
*/
118118
parse( text, path ) {
119119

examples/jsm/loaders/GLTFLoader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ class GLTFParser {
29432943
* @private
29442944
* @param {string} type
29452945
* @param {number} index
2946-
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
2946+
* @return {Promise<Object3D|Material|Texture|AnimationClip|ArrayBuffer|Object>}
29472947
*/
29482948
getDependency( type, index ) {
29492949

@@ -3283,7 +3283,7 @@ class GLTFParser {
32833283
*
32843284
* @private
32853285
* @param {number} textureIndex
3286-
* @return {Promise<THREE.Texture|null>}
3286+
* @return {Promise<?Texture>}
32873287
*/
32883288
loadTexture( textureIndex ) {
32893289

@@ -4020,7 +4020,7 @@ class GLTFParser {
40204020
*
40214021
* @private
40224022
* @param {number} cameraIndex
4023-
* @return {Promise<THREE.Camera>}
4023+
* @return {Promise<Camera>|undefined}
40244024
*/
40254025
loadCamera( cameraIndex ) {
40264026

examples/jsm/math/ConvexHull.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class ConvexHull {
152152
*
153153
* @param {Ray} ray - The ray to test.
154154
* @param {Vector3} target - The target vector that is used to store the method's result.
155-
* @return {Vector3|null} The intersection point. Returns `null` if not intersection was detected.
155+
* @return {?Vector3} The intersection point. Returns `null` if not intersection was detected.
156156
*/
157157
intersectRay( ray, target ) {
158158

@@ -1298,7 +1298,7 @@ class HalfEdge {
12981298
* Returns the origin vertex.
12991299
*
13001300
* @private
1301-
* @return {VertexNode} The destination vertex.
1301+
* @return {?VertexNode} The destination vertex.
13021302
*/
13031303
tail() {
13041304

examples/jsm/misc/MD2CharacterComplex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class MD2CharacterComplex {
121121
/**
122122
* The movement controls.
123123
*
124-
* @type {Object}
124+
* @type {?Object}
125125
* @default null
126126
*/
127127
this.controls = null;

examples/jsm/misc/ProgressiveLightMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class ProgressiveLightMap {
280280
*
281281
* @private
282282
* @param {number} res - The square resolution of this object's lightMap.
283-
* @param {WebGLRenderTarget} [lightMap] - The lightmap to initialize the plane with.
283+
* @param {?WebGLRenderTarget} [lightMap] - The lightmap to initialize the plane with.
284284
*/
285285
_initializeBlurPlane( res, lightMap = null ) {
286286

examples/jsm/tsl/display/ChromaticAberrationNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export default ChromaticAberrationNode;
189189
* @function
190190
* @param {Node<vec4>} node - The node that represents the input of the effect.
191191
* @param {Node|number} [strength=1.0] - The strength of the chromatic aberration effect as a node or value.
192-
* @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).
192+
* @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).
193193
* @param {Node|number} [scale=1.1] - The scale factor for stepped scaling from center as a node or value.
194194
* @returns {ChromaticAberrationNode}
195195
*/

examples/jsm/utils/BufferGeometryUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ function deepCloneAttribute( attribute ) {
446446
* single {@link InterleavedBuffer} instance. All attributes must have compatible types.
447447
*
448448
* @param {Array<BufferAttribute>} attributes - The attributes to interleave.
449-
* @return {Array<InterleavedBufferAttribute>} An array of interleaved attributes. If interleave does not succeed, the method returns `null`.
449+
* @return {?Array<InterleavedBufferAttribute>} An array of interleaved attributes. If interleave does not succeed, the method returns `null`.
450450
*/
451451
function interleaveAttributes( attributes ) {
452452

0 commit comments

Comments
 (0)