Skip to content

@modoki/engine / index / ManagerDef

Interface: ManagerDef

A Manager is a plain singleton implementing this shape. registerManager only wires its lifecycle + owned actions — other code calls its methods by importing the singleton directly (no service locator).

Extended by

Managers

actions?

optional actions?: Record<string, UIActionDef | UIActionHandler>

Named UIAction handlers owned by this manager (same shape systems use). Registered on activate, removed on deactivate.


games?

optional games?: string[]

Game scope only: active-game ids to match; omit = every game.


name

name: string


scenes?

optional scenes?: string[]

Scene scope only: path substrings to match; omit = every scene.


scope?

optional scope?: ManagerScope

Default 'scene'.


dispose()?

optional dispose(ctx?): void

ctx carries the world the manager was operating against (on a scene swap this is the OLD world, still alive until just after dispose runs) so a dispose can tear down world-bound state on the correct world. Optional.

Parameters

ctx?

ManagerContext

Returns

void


init()?

optional init(ctx): void | Promise<void>

Parameters

ctx

ManagerContext

Returns

void | Promise<void>

Built with Modoki.