API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
typeApplicationOf
Normalizes an ApplicationLike to its concrete `Application` instance type, letting Scene's second generic accept an `Application` instance type, its constructor, or `typeof someAppInstance` interchangeably. `typeof someAppInstance` only works once the instance already has an explicit, non-inferred type - a fully-inferred `const app = new Application({ scenes: {...} })` cannot be threaded through a self-referential base-scene chain this way (confirmed: TS2506/TS7022 - the inference cycle runs through the un-annotated `const`'s own initializer, which ordinary lazy interface/type-alias resolution does not rescue). Break the cycle with an explicit fixed point instead - a named `Application` subclass with a hand-written registry type: class GameApplication extends Application<GameScenes> {} export const app: GameApplication = new GameApplication({ scenes: {...} }); // in a second module: export abstract class AppScene<Data = void> extends Scene<Data, typeof app> {} The cross-file `import type` this introduces is a type-only module cycle - unproblematic, erased entirely at compile time.
import { ApplicationOf } from '@codexo/exojs'Normalizes an ApplicationLike to its concrete `Application` instance type, letting Scene's second generic accept an `Application` instance type, its constructor, or `typeof someAppInstance` interchangeably.
`typeof someAppInstance` only works once the instance already has an explicit, non-inferred type - a fully-inferred `const app = new Application({ scenes: {...} })` cannot be threaded through a self-referential base-scene chain this way (confirmed: TS2506/TS7022 - the inference cycle runs through the un-annotated `const`'s own initializer, which ordinary lazy interface/type-alias resolution does not rescue). Break the cycle with an explicit fixed point instead - a named `Application` subclass with a hand-written registry type:
class GameApplication extends Application<GameScenes> {} export const app: GameApplication = new GameApplication({ scenes: {...} }); // in a second module: export abstract class AppScene<Data = void> extends Scene<Data, typeof app> {}
The cross-file `import type` this introduces is a type-only module cycle - unproblematic, erased entirely at compile time.
T extends (args: any[]) => Instance ? Instance extends ApplicationTop-level engine instance. Owns the canvas, render backend, scene-stack controller, the core systems (input, interaction, audio, coroutines, tweens, animations…<any> ? Instance : never : T extends ApplicationTop-level engine instance. Owns the canvas, render backend, scene-stack controller, the core systems (input, interaction, audio, coroutines, tweens, animations…<any> ? T : never