Skip to content

docs: document both halves of accessor pairs in public API#8634

Merged
willeastcott merged 2 commits into
mainfrom
docs-accessor-jsdoc-pairs
Apr 22, 2026
Merged

docs: document both halves of accessor pairs in public API#8634
willeastcott merged 2 commits into
mainfrom
docs-accessor-jsdoc-pairs

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

Summary

Brings a handful of public-API accessors into line with the engine's documentation convention (demonstrated by Mesh#aabb in src/scene/mesh.js), where both halves of a get/set pair carry their own JSDoc block and @type.

The fix targets only accessors that actually appear in the generated API reference (classes with a class-level JSDoc block and no @ignore/@private). Classes excluded from the API reference by TypeDoc's excludeNotDocumented: true were left alone.

Accessors updated

  • Script.enabled - setter rephrased to "Sets the enabled state...", matching getter added describing the AND of entity/component/destroyed state.
  • Sky.type, Sky.center, Sky.fisheye - setters rephrased to "Sets the ...", matching getters added. While in the file, Sky.depthWrite was also retuned to "Sets whether..."/"Gets whether..." so all four Sky accessors read consistently.
  • GSplatParams.renderer, GSplatParams.debug - setters rephrased to "Sets the ...", matching getters added. The renderer getter notes the potential divergence from currentRenderer under WebGL fallback.
  • GSplatComponent.splatBudget - getter now carries the same @deprecated/@type block as the setter, matching the neighbouring lodDistances pair.
  • SingleGestureSource.layout, DualGestureSource.layout - setters rephrased to "Sets the layout...", matching getters added. For DualGestureSource, the previously bare @type setter doc was expanded to describe the hyphen-separated left/right form and default.

Incidental JSDoc cleanup

  • Batch#model: reordered JSDoc tags so @type precedes @deprecated/@ignore.
  • GSplatParams#colorizeLod: added missing @type {boolean} on setter, normalized @returns to @type {boolean} on getter, and added @ignore.

Verification

  • Custom static scan for get/set JSDoc mismatches in the public API: 0 remaining after these changes (17 remaining mismatches are all inside @ignore/undocumented classes not exposed in the API reference).
  • npm run lint - clean (one pre-existing unrelated warning in utils/rollup-build-target.mjs).
  • npm run build:types - build/playcanvas.d.ts builds without errors.

Public API changes

No behaviour changes. Documentation-only; all affected accessors keep the same name, type, and runtime semantics.

Follows the Mesh#aabb convention (independent JSDoc block with @type on each
half of a get/set pair). Previously only one side was documented on a handful
of public-API accessors.

- Script.enabled
- Sky.type, Sky.center, Sky.fisheye (plus depthWrite phrasing tidy)
- GSplatParams.renderer, GSplatParams.debug
- GSplatComponent.splatBudget (deprecated; matches adjacent lodDistances pair)
- SingleGestureSource.layout, DualGestureSource.layout

Also minor JSDoc tag reordering on Batch#model and GSplatParams#colorizeLod.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns public API documentation for accessor pairs (get/set) with the engine’s JSDoc/TypeDoc convention by ensuring both halves have their own JSDoc blocks (including @type) and consistent “Sets…” / “Gets…” phrasing. This improves generated API reference consistency without changing runtime behavior.

Changes:

  • Added missing JSDoc blocks (and @type) for the getter half of multiple public accessors; rephrased setter docs for consistency.
  • Normalized / cleaned up deprecated accessor docs (tag ordering, missing @type, and added @ignore where appropriate).
  • Minor copy edits to keep “Defaults…” and “Gets/Sets…” wording consistent across related properties.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/scene/skybox/sky.js Adds getter JSDoc for type/center/fisheye and normalizes “Gets/Sets…” wording (incl. depthWrite).
src/scene/gsplat-unified/gsplat-params.js Documents getter halves for renderer/debug; cleans up deprecated colorizeLod docs and adds @ignore.
src/scene/batching/batch.js Reorders JSDoc tags on deprecated model getter.
src/framework/script/script.js Adds getter JSDoc for enabled and rephrases setter documentation.
src/framework/components/gsplat/component.js Ensures both halves of deprecated accessors carry consistent @type/@deprecated and adds @ignore.
src/extras/input/sources/single-gesture-source.js Adds getter JSDoc for layout and normalizes wording.
src/extras/input/sources/dual-gesture-source.js Expands setter JSDoc for layout and adds matching getter JSDoc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/framework/script/script.js
@willeastcott willeastcott merged commit 2eb563f into main Apr 22, 2026
8 checks passed
@willeastcott willeastcott deleted the docs-accessor-jsdoc-pairs branch April 22, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants