Skip to content

refactor(collision): correct JSDoc visibility tags on internal methods#8888

Merged
willeastcott merged 2 commits into
mainfrom
refactor-collision-onbeforeremove-tag
Jun 12, 2026
Merged

refactor(collision): correct JSDoc visibility tags on internal methods#8888
willeastcott merged 2 commits into
mainfrom
refactor-collision-onbeforeremove-tag

Conversation

@willeastcott

@willeastcott willeastcott commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the onBeforeRemove standardization in the component-consistency series. Two JSDoc visibility fixes in CollisionComponent, both verified against the generated .d.ts:

onBeforeRemove - drop the stray @private

Collision was the only one of the 20 components tagging its onBeforeRemove lifecycle hook - every other component declares it bare, like onEnable/onDisable. The tag also made build:types emit the method as a private member in the published declarations while the other 19 are public. It now emits onBeforeRemove(): void;, identical to the rest.

getCompoundChildShapeIndex - @private -> @ignore, type the param

The method is called by CollisionComponentSystem from outside the class, so @private was inaccurate (and emitted a private member in the .d.ts that the system nonetheless calls). @ignore matches the convention set by the base Component class for methods that systems invoke (onEnable, onSetEnabled, buildAccessors, etc.) - hidden from the API docs but public in the declarations. Also replaces @param {*} with {object}, following the precedent of RigidBodyComponent._getEntityTransform for Ammo-typed parameters. The declaration is now getCompoundChildShapeIndex(shape: object): number | null;.

If we later want lifecycle hooks excluded from the generated API docs, that should be a uniform @ignore sweep across all components rather than a one-off.

Verified with npm test, npm run lint, npm run build:types + npm run test:types.

🤖 Generated with Claude Code

CollisionComponent was the only one of the 20 components tagging its
onBeforeRemove lifecycle hook - every other component declares it bare,
like onEnable/onDisable. The tag also made build:types emit the method
as a private member in the published declarations while the other 19
are public.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e its param

The method is called by CollisionComponentSystem from outside the class,
so @ignore is the accurate tag - matching the base Component lifecycle
hooks (onEnable, onSetEnabled, buildAccessors) that systems invoke. The
@Private tag wrongly emitted it as a private member in the published
declarations.

Also replaces @param {*} with {object}, following the precedent set by
RigidBodyComponent._getEntityTransform for Ammo-typed parameters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willeastcott willeastcott changed the title refactor(collision): drop stray @private tag from onBeforeRemove refactor(collision): correct JSDoc visibility tags on internal methods Jun 12, 2026
@willeastcott willeastcott merged commit 16009ac into main Jun 12, 2026
9 checks passed
@willeastcott willeastcott deleted the refactor-collision-onbeforeremove-tag branch June 12, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant