Skip to content

ExtensionWindow

Defined in: window/extension.ts:42

This utility class represents the extension window. It allows manipulation of the window (e.g., resizing), and also serves as an event emitter for all events that the window should be able to handle.

Currently, the following events are available:

  • scene-load: notifies in the event of a scene change. Handler is a function f(sceneNumber: number). For Split Mode scene-load listens to the changes on the preview window.
  • sources-list-highlight: notifies when a user hovers over a source in the stage, returning its source id, or when the mouse moves out of a source bounding box, returning null. Source id is also returned when hovering over the bottom panel. Handler is a function f(id: string)
  • sources-list-select: notifies when a user clicks a source in the stage. Source id is also returned when source is selected from the bottom panel. Handler is a function f(id: string)
  • sources-list-update: notifies when there are changes on list sources whether on stage or bottom panel. Handler is a function(ids: string) where ids are comma separated source ids.
  • scene-delete : notifies when a scene is deleted. Handler is a function f(index: number, uid: string). Works only on version 2.8.1606.1601 or higher.
  • scene-add : notifies when a scene is added. Handler is a function f(index: number, uid: string). Works only on version 2.8.1606.1701 or higher.
  • scene-delete-all : notifies all scenes are deleted. Handler is a function f(type: newpres/loadpres). Works only on version 3.3.1801.1901 or higher.
  • bscn-load : notifies when user loads a scene file via XBC, File menu > Load Scene…
  • push-to-live : notifies when a particular scene was pushed to live by user. Handler is a function f(sceneIndex: number).

Use the on(event: string, handler: Function) function to listen to an event.

  • EventEmitter

new ExtensionWindow(): ExtensionWindow

Defined in: window/extension.ts:65

** For Deprecation

Use getInstance()

ExtensionWindow

EventEmitter.constructor

static _encounteredFirstSceneChange: boolean = false

Defined in: window/extension.ts:45


static _proxyHandlers: object = {}

Defined in: util/eventemitter.ts:7

EventEmitter._proxyHandlers


static _remoteHandlers: object = {}

Defined in: util/eventemitter.ts:6

EventEmitter._remoteHandlers


static _subscriptions: string[] = []

Defined in: window/extension.ts:44


static _value: string

Defined in: window/extension.ts:336

close(): void

Defined in: window/extension.ts:403

** For deprecation, please use the static method instead

void


disableClose(): void

Defined in: window/extension.ts:417

** For deprecation, please use the static method instead

void


emit(event, …params): void

Defined in: util/eventemitter.ts:66

This function lets an event trigger with any number of supplied parameters.

string

any[]

void

EventEmitter.emit


enableClose(): void

Defined in: window/extension.ts:431

** For deprecation, please use the static method instead

void


off(event, handler): void

Defined in: util/eventemitter.ts:37

This function removes a handler to an event.

string

Function

void

EventEmitter.off


on(event, handler, _id?): void

Defined in: util/eventemitter.ts:10

This function attaches a handler to an event. Duplicate handlers are allowed.

string

Function

string

void

EventEmitter.on


resize(width, height): void

Defined in: window/extension.ts:332

** For deprecation, please use the static method instead

number

number

void


setBorder(flag): void

Defined in: window/extension.ts:389

** For deprecation, please use the static method instead

number

void


setTitle(value): Promise<any>

Defined in: window/extension.ts:357

** For deprecation, please use the static method instead

string

Promise<any>


static _finalCallback(message): Promise<void>

Defined in: util/eventemitter.ts:99

string

Promise<void>

EventEmitter._finalCallback


static _setCallback(message): Promise<unknown>

Defined in: util/eventemitter.ts:90

string

Promise<unknown>

EventEmitter._setCallback


static close(): void

Defined in: window/extension.ts:396

Closes this extension window

void


static disableClose(): void

Defined in: window/extension.ts:410

Disable Close Button on this extension’s window

void


static emit(event, …params): void

Defined in: window/extension.ts:80

param: (event: string, …params: any[])

Allows this class to emit an event.

string

any[]

void


static enableClose(): void

Defined in: window/extension.ts:424

Enable Close Button on this extension’s window

void


static getInstance(): ExtensionWindow

Defined in: window/extension.ts:53

** For deprecation, the need for getting the instance of an ExtensionWindow looks redundant, ** since an ExtensionWinow should technically have a single instance

Gets the instance of the window utility. Use this instead of the constructor.

ExtensionWindow


static off(event, handler): void

Defined in: window/extension.ts:317

string

Function

void


static on(event, handler): Promise<any>

Defined in: window/extension.ts:95

param: (event: string, handler: Function)

Allows listening to events that this class emits.

string

Function

Promise<any>


static resize(width, height): void

Defined in: window/extension.ts:325

param: (width: number, height: number)

Resizes this extension’s window.

number

number

void


static setBorder(flag): void

Defined in: window/extension.ts:382

param (flag: number)

Modifies this extension’s window border.

‘4’ is th e base command on setting border flags.

Flags can be: (bit 0 - enable border) (bit 1 - enable caption) (bit 2 - enable sizing) (bit 3 - enable minimize btn) (bit 4 - enable maximize btn)

number

void


static setTitle(value): Promise<any>

Defined in: window/extension.ts:343

param: (value: string)

Renames the extension window.

string

Promise<any>