Commit b662e48
Convert Stage class from JavaScript to TypeScript (#1371)
* Convert Stage class from JavaScript to TypeScript
- Add proper type annotations for all properties, methods, and parameters
- Type onResetEvent/onDestroyEvent with Application parameter
- Fix light.update()/preDraw()/draw()/postDraw() calls to match actual signatures
(previously passing unused extra arguments silently ignored by JS)
- Add StageSettings interface for constructor options
- Update all import paths from stage.js to stage.ts
- Add Stage unit tests (constructor, settings callbacks, update return value)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update state.ts documentation to use modern import-based API
- Replace me.state/me.Stage/me.GUI_Object with direct imports in examples
- Update state.change() example to include forceChange parameter
- Use const instead of let in USER constant example
- Remove unused Color import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix lint errors and address PR review comments
- Fix boolean comparisons: use direct truthiness instead of === true/false
- Fix arrow-body-style in tests (block statements for arrow functions)
- Use import type for Stage in event.ts (type-only usage)
- Make app parameter required in onResetEvent/onDestroyEvent signatures
- Type StageSettings.onResetEvent with explicit Application parameter
- Fix typos: renderered → rendered, Renderering → Rendering, reseting → resetting
- Update lights example to use modern import style
- Remove unused Container import comment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 72494cf commit b662e48
7 files changed
Lines changed: 303 additions & 264 deletions
File tree
- packages/melonjs
- src
- loader
- state
- system
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
This file was deleted.
0 commit comments