Version
- Phaser Version: v3.90.0
- Operating system: Ubuntu 24.04 LTS (irrelevant)
Description
The published .d.ts files for Phaser do not include the string names of various event constants.
This means external consumers using Phaser in a TypeScript project will see the types of PhaserCore..Events.BOOT as string, not the actual "boot" value that it assumes at runtime, making strongly typing event-related code effectively impossible.
Example Test Code
import Phaser from "phaser";
type bootEvt = typeof Phaser.Core.Events.BOOT;
// ^ string, not "boot"
Additional Information
This can be easily fixed by changing the @type {string}s inside the [module code](https://github.com/phaserjs/phaser/blob/master/src/core/events/BLUR_EVENT.js#L7 to the actual value of their respective constants.
I might make a PR for this if I find the time; it is fairly easy and quick to fix (as well as something an end user cannot fix simply by overriding Phaser's typings)
Version
Description
The published
.d.tsfiles for Phaser do not include the string names of various event constants.This means external consumers using Phaser in a TypeScript project will see the types of
PhaserCore..Events.BOOTasstring, not the actual"boot"value that it assumes at runtime, making strongly typing event-related code effectively impossible.Example Test Code
Additional Information
This can be easily fixed by changing the
@type {string}s inside the [module code](https://github.com/phaserjs/phaser/blob/master/src/core/events/BLUR_EVENT.js#L7 to the actual value of their respective constants.I might make a PR for this if I find the time; it is fairly easy and quick to fix (as well as something an end user cannot fix simply by overriding Phaser's typings)