Skip to content

Commit b662e48

Browse files
obiotclaude
andauthored
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/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import Trigger from "./renderable/trigger.js";
4343
import UIBaseElement from "./renderable/ui/uibaseelement.ts";
4444
import UISpriteElement from "./renderable/ui/uispriteelement.ts";
4545
import UITextButton from "./renderable/ui/uitextbutton.ts";
46-
import Stage from "./state/stage.js";
46+
import Stage from "./state/stage.ts";
4747
import state from "./state/state.ts";
4848
import { boot } from "./system/bootstrap.ts";
4949
import { DOMContentLoaded } from "./system/dom.ts";

packages/melonjs/src/loader/loadingscreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Renderable from "./../renderable/renderable.js";
22
import Sprite from "./../renderable/sprite.js";
3-
import Stage from "./../state/stage.js";
3+
import Stage from "./../state/stage.ts";
44
import {
55
LOADER_COMPLETE,
66
LOADER_PROGRESS,

packages/melonjs/src/state/stage.js

Lines changed: 0 additions & 226 deletions
This file was deleted.

0 commit comments

Comments
 (0)