Total decoupling
The logic communicates only through the typed EngineEventBus. The UI (Phaser or otherwise) merely listens to events, never depending on the heart of the engine.
A modular, polymorphic and plug-and-play engine for TypeScript and PhaserJS. It computes the game math and notifies the outside world through a typed Event Bus.