Skip to content

Commit 1e4d727

Browse files
authored
docs: fix more incorrect JSDoc in public APIs (#8615)
* docs: fix more incorrect JSDoc in public APIs Made-with: Cursor * docs: correct registerKeys description and document @throws Made-with: Cursor * docs: register with registry, not to it Made-with: Cursor * docs: align @param app wording with summary Made-with: Cursor * docs: close quote in URI#setQuery example comment Made-with: Cursor
1 parent 97a301f commit 1e4d727

7 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/core/indexed-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class IndexedList {
1717
_index = {};
1818

1919
/**
20-
* Add a new item into the list with a index key.
20+
* Add a new item into the list with an index key.
2121
*
2222
* @param {string} key - Key used to look up item in index.
2323
* @param {object} item - Item to be stored.

src/core/uri.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class URI {
169169
}
170170

171171
/**
172-
* Set the query section of the URI from a Object.
172+
* Set the query section of the URI from an Object.
173173
*
174174
* @param {object} params - Key-Value pairs to encode into the query string.
175175
* @example
@@ -179,7 +179,7 @@ class URI {
179179
* "a": 1,
180180
* "b": 2
181181
* });
182-
* console.log(uri.toString()); // logs "http://example.com?a=1&b=2
182+
* console.log(uri.toString()); // logs "http://example.com?a=1&b=2"
183183
*/
184184
setQuery(params) {
185185
let q = '';

src/extras/render-passes/render-pass-upsample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import wgslUpsamplePS from '../../scene/shader-lib/wgsl/chunks/render-pass/frag/
66
import { ShaderChunks } from '../../scene/shader-lib/shader-chunks.js';
77

88
/**
9-
* Render pass implementation of a up-sample filter.
9+
* Render pass implementation of an up-sample filter.
1010
*
1111
* @category Graphics
1212
* @ignore

src/framework/script/script-create.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ ScriptAttributes.reservedNames.forEach((value, value2, set) => {
8383
createScript.reservedAttributes = reservedAttributes;
8484

8585
/**
86-
* Register a existing class type as a Script Type to {@link ScriptRegistry}. Useful when defining
87-
* a ES6 script class that extends {@link ScriptType} (see example).
86+
* Register an existing class type as a Script Type with {@link ScriptRegistry}. Useful when defining
87+
* an ES6 script class that extends {@link ScriptType} (see example).
8888
*
8989
* @param {typeof ScriptType} script - The existing class type (constructor function) to be
9090
* registered as a Script Type. Class must extend {@link ScriptType} (see example). Please note: A
91-
* class created using {@link createScript} is auto-registered, and should therefore not be pass
91+
* class created using {@link createScript} is auto-registered, and should therefore not be passed
9292
* into {@link registerScript} (which would result in swapping out all related script instances).
9393
* @param {string} [name] - Optional unique name of the Script Type. By default it will use the
9494
* same name as the existing class. If a Script Type with the same name has already been registered
@@ -98,10 +98,10 @@ createScript.reservedAttributes = reservedAttributes;
9898
* (underscore): system, entity, create, destroy, swap, move, scripts, onEnable, onDisable,
9999
* onPostStateChange, has, on, off, fire, once, hasEvent.
100100
* @param {AppBase} [app] - Optional application handler, to choose which {@link ScriptRegistry}
101-
* to register the script type to. By default it will use `Application.getApplication()` to get
102-
* current {@link AppBase}.
101+
* to register the script type with. By default it will use `Application.getApplication()` to get
102+
* the current {@link AppBase}.
103103
* @example
104-
* // define a ES6 script class
104+
* // define an ES6 script class
105105
* class PlayerController extends pc.ScriptType {
106106
*
107107
* initialize() {

src/platform/graphics/vertex-iterator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ class VertexIteratorAccessor {
172172
}
173173

174174
/**
175-
* Get a attribute component at the iterator's current index.
175+
* Get an attribute component at the iterator's current index.
176176
*
177177
* @param {number} offset - The component offset. Should be either 0, 1, 2, or 3.
178-
* @returns {number} The value of a attribute component.
178+
* @returns {number} The value of an attribute component.
179179
*/
180180
get(offset) {
181181
return this.array[this.index + offset];

src/platform/input/controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,11 @@ class Controller {
168168
}
169169

170170
/**
171-
* Create or update a action which is enabled when the supplied keys are pressed.
171+
* Register a new action which is enabled when the supplied keys are pressed.
172172
*
173173
* @param {string} action - The name of the action.
174174
* @param {number[]} keys - A list of keycodes.
175+
* @throws {Error} If the action is already registered, or if `keys` is undefined.
175176
*/
176177
registerKeys(action, keys) {
177178
if (!this._keyboard) {

src/scene/light.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ class Light {
11031103
}
11041104

11051105
/**
1106-
* Updates a integer key for the light. The key is used to identify all shader related features
1106+
* Updates an integer key for the light. The key is used to identify all shader related features
11071107
* of the light, and so needs to have all properties that modify the generated shader encoded.
11081108
* Properties without an effect on the shader (color, shadow intensity) should not be encoded.
11091109
*/

0 commit comments

Comments
 (0)