Skip to content

Commit

Permalink
Leverage @import tag to simplify JSDoc (#6786)
Browse files Browse the repository at this point in the history
* Leverage @import tag to simplify JSDoc

* Use 100 columns

* Import ordering

* Use 100 columns

* Use 100 columns

* Import ordering

* Use 100 columns

* Use 100 columns

* Update TypeScript to 5.5

* Font fix

* Light fix

* Use 100 columns

* Use 100 columns

* Tweak Plane#normalize

* Gizmo tweaks

* Ensure correct spacing of braces
  • Loading branch information
willeastcott authored Jul 8, 2024
1 parent 3c568b2 commit 1698f10
Show file tree
Hide file tree
Showing 267 changed files with 3,161 additions and 2,205 deletions.
147 changes: 87 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
"error",
{
"definedTags": [
"attribute",
"category",
"attribute"
"import"
]
}
]
Expand Down Expand Up @@ -132,9 +133,9 @@
"rollup-plugin-visualizer": "^5.12.0",
"serve": "^14.2.2",
"sinon": "^17.0.1",
"typedoc": "^0.25.13",
"typedoc-plugin-mdn-links": "^3.1.22",
"typescript": "^5.4.5",
"typedoc": "^0.26.3",
"typedoc-plugin-mdn-links": "^3.2.2",
"typescript": "^5.5.3",
"xhr2": "^0.2.1"
},
"scripts": {
Expand Down
13 changes: 9 additions & 4 deletions src/core/event-handle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Debug } from '../core/debug.js';

/**
* @import { EventHandler } from './event-handler.js'
* @import { HandleEventCallback } from './event-handler.js'
*/

/**
* Event Handle that is created by {@link EventHandler} and can be used for easier event removal
* and management.
Expand Down Expand Up @@ -27,7 +32,7 @@ import { Debug } from '../core/debug.js';
*/
class EventHandle {
/**
* @type {import('./event-handler.js').EventHandler}
* @type {EventHandler}
* @private
*/
handler;
Expand All @@ -39,7 +44,7 @@ class EventHandle {
name;

/**
* @type {import('./event-handler.js').HandleEventCallback}
* @type {HandleEventCallback}
* @ignore
*/
callback;
Expand All @@ -64,9 +69,9 @@ class EventHandle {
_removed = false;

/**
* @param {import('./event-handler.js').EventHandler} handler - source object of the event.
* @param {EventHandler} handler - source object of the event.
* @param {string} name - Name of the event.
* @param {import('./event-handler.js').HandleEventCallback} callback - Function that is called when event is fired.
* @param {HandleEventCallback} callback - Function that is called when event is fired.
* @param {object} scope - Object that is used as `this` when event is fired.
* @param {boolean} [once] - If this is a single event and will be removed after event is fired.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/core/math/curve-evaluator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { CURVE_LINEAR, CURVE_SMOOTHSTEP, CURVE_SPLINE, CURVE_STEP } from './constants.js';
import { math } from './math.js';

/**
* @import { Curve } from './curve.js'
*/

/**
* A class for evaluating a curve at a specific time.
*/
Expand Down Expand Up @@ -32,7 +36,7 @@ class CurveEvaluator {
/**
* Create a new CurveEvaluator instance.
*
* @param {import('./curve.js').Curve} curve - The curve to evaluate.
* @param {Curve} curve - The curve to evaluate.
* @param {number} time - The initial time to evaluate the curve at. Defaults to 0.
*/
constructor(curve, time = 0) {
Expand Down
11 changes: 8 additions & 3 deletions src/core/math/mat3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Vec3 } from './vec3.js';

/**
* @import { Mat4 } from './mat4.js'
* @import { Quat } from './quat.js'
*/

/**
* A 3x3 matrix.
*
Expand Down Expand Up @@ -242,7 +247,7 @@ class Mat3 {
/**
* Converts the specified 4x4 matrix to a Mat3.
*
* @param {import('./mat4.js').Mat4} m - The 4x4 matrix to convert.
* @param {Mat4} m - The 4x4 matrix to convert.
* @returns {Mat3} Self for chaining.
*/
setFromMat4(m) {
Expand All @@ -267,7 +272,7 @@ class Mat3 {
/**
* Sets this matrix to the given quaternion rotation.
*
* @param {import('./quat.js').Quat} r - A quaternion rotation.
* @param {Quat} r - A quaternion rotation.
* @returns {Mat3} Self for chaining.
* @example
* const r = new pc.Quat(1, 2, 3, 4).normalize();
Expand Down Expand Up @@ -314,7 +319,7 @@ class Mat3 {
/**
* Set the matrix to the inverse of the specified 4x4 matrix.
*
* @param {import('./mat4.js').Mat4} src - The 4x4 matrix to invert.
* @param {Mat4} src - The 4x4 matrix to invert.
* @returns {Mat3} Self for chaining.
*
* @ignore
Expand Down
Loading

0 comments on commit 1698f10

Please sign in to comment.