Fix BaseTween callback types - #7376
Open
bagel786 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The shipped types/phaser.d.ts artifact still contains the incorrect callback declarations.
Pull request overview
Fixes BaseTween callback typings to match runtime handler objects and adds TypeScript regression coverage.
Changes:
- Adds nullable callback handler and parameter typings.
- Clarifies callback documentation.
- Adds generated TypeScript usage coverage.
File summaries
| File | Summary |
|---|---|
src/tweens/typedefs/TweenCallbacks.js |
Defines corrected callback handler types. |
src/tweens/tween/BaseTween.js |
Updates callback documentation. |
scripts/tsgen/test/src/game.ts |
Verifies generated callback typings. |
Review details
Suppressed comments (1)
src/tweens/typedefs/TweenCallbacks.js:6
- The package exports
types/phaser.d.ts(package.json:12,17), but that generated file still declaresTweenCallbacksas optional callback functions (types/phaser.d.ts:105134-105175). Runningnpm run tsmay update it locally, but the declaration artifact is not included in this change, so package consumers will continue to see the incorrect API; regenerate and commit the published declaration (or otherwise update the shipped type artifact).
* @typedef {object} Phaser.Types.Tweens.TweenCallbackData
* @since 4.3.0
*
* @property {function} func - The callback function.
* @property {array} params - Additional parameters to pass to the callback.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR
Model BaseTween callback slots as the required nullable handler objects used at runtime, including their callback parameters. Add a TypeScript generation regression for every callback key.
Tests:
npm run tsFixes #7353