Skip to content

Docs: correct RandomZoneSourceCallback parameter type - #7389

Open
Wrethis wants to merge 1 commit into
phaserjs:masterfrom
Wrethis:docs/6784-random-zone-source-callback
Open

Wrethis wants to merge 1 commit into
phaserjs:masterfrom
Wrethis:docs/6784-random-zone-source-callback

Conversation

@Wrethis

@Wrethis Wrethis commented Sep 30, 2026

Copy link
Copy Markdown

Fixes #6784

RandomZoneSourceCallback typed its point argument as Phaser.Types.Math.Vector2Like, but every Geom shape declares getRandomPoint<O extends Phaser.Math.Vector2>, so the generated typings rejected new RandomZone(new Phaser.Geom.Rectangle(...)) with TS2345. RandomZone#getPoint() always passes a Phaser.Math.Vector2, so the JSDoc now says so. Custom sources typed with Vector2Like still compile.

Also adds Geom shape RandomZone sources to the tsgen test project: npm run ts fails without the JSDoc change and passes with it. Linted the change with the .eslintrc.json rules (npm run lint itself currently fails on master, see #7303).

Copilot AI balanced review requested due to automatic review settings September 30, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Incorrect typing for Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback

2 participants