Skip to main content

Interface: OverlayContext

Context passed to overlay plugins when they are mounted on the stage. Provides the DOM containers, stage dimensions, navigation methods, and event subscriptions.

Properties​

PropertyTypeDescription
containerHTMLElementThe stage top-level container element (screen space).
heightnumberVirtual stage height in pixels (e.g. 1080).
themeThemeConfigActive stage theme configuration.
viewportHTMLElementThe scaled virtual viewport element (e.g. 1920×1080).
widthnumberVirtual stage width in pixels (e.g. 1920).

Methods​

emit()​

emit<K extends keyof StageEventMap>(event: K, ...args: StageEventMap[K] extends undefined ? [] : [StageEventMap[K]]): void

Emit an event on the stage event bus.

Type Parameters​

Type Parameter
K extends keyof StageEventMap

Parameters​

ParameterType
eventK
...argsStageEventMap[K] extends undefined ? [] : [StageEventMap[K]]

Returns​

void


next()​

next(): void

Advance to the next step.

Returns​

void


nextScene()​

nextScene(): void

Jump to the first step of the next scene.

Returns​

void


on()​

on<K extends keyof StageEventMap>(event: K, handler: (data: StageEventMap[K]) => void): () => void

Subscribe to stage events. Returns an unsubscribe function.

Type Parameters​

Type Parameter
K extends keyof StageEventMap

Parameters​

ParameterType
eventK
handler(data: StageEventMap[K]) => void

Returns​

() => void


prev()​

prev(): void

Go back to the previous step.

Returns​

void


prevScene()​

prevScene(): void

Jump to the first step of the previous scene.

Returns​

void