marklovers / kaplay

🦖 A JavaScript game library
https://kaplayjs.com
MIT License
248 stars 17 forks source link

feat: declaration maps, avoid duplicated types #135

Closed lajbel closed 4 weeks ago

lajbel commented 1 month ago

This PR address to fix issues related to the types duplication between modules, for example Vec2 between math.ts and types.ts, etc. To do this, an esbuild plugin is used, it generates the declaration files for every module.

The declaration maps adds the possibility of go direct to the source code with clicked in a Symbol, for example Vec2

close #126 close #97

Note: Not all replacements to duplicated types are addressed, only Vec2, Asset, FontData and related to events (Event, EventControllers), they should be addressed, but I don't want much merge conflicts so others will be addressed in others PR. Also the idea is move CompOpts to their own component file

It also separates FontData from kaboom.ts to new module fonts.ts (may be temp)