Skip to content

SourcePluginWindow

Defined in: window/source.ts:27

This utility class is used internally by the framework for certain important processes. This class also exposes certain important events that the source plugin may emit.

Inherits from: #util/EventEmitter Util/EventEmitter

Currently, the following events are available:

  • save-config: signals the source that it should save the configuration object. Handler is a function f(config: JSON)
  • apply-config: signals the source that it should apply the changes that this configuration object describes. Handler is a function f(config: JSON)
  • set-background-color: only used when the native Color tab is reused and background color is set. Handler is a function f(colorHexNoNumberSign: string)
  • scene-load: signals the source that the active scene is the scene where it is loaded. Only works on sources loaded in memory
  • scene-delete : notifies when a user deletes a scene. Handler is a function f(index: number). Works only on version 2.8.1606.1601 or higher.

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

new SourcePluginWindow(): SourcePluginWindow

Defined in: window/source.ts:49

** For Deprecation

Use getInstance()

SourcePluginWindow

EventEmitter.constructor

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/source.ts:29

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


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


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 emit(event, …params): void

Defined in: window/source.ts:73

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

Allows this class to emit an event.

string

any[]

void


static getInstance(): SourcePluginWindow

Defined in: window/source.ts:37

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

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

SourcePluginWindow


static off(event, handler): void

Defined in: window/source.ts:115

string

Function

void


static on(event, handler): void

Defined in: window/source.ts:88

param: (event: string, handler: Function)

Allows listening to events that this class emits.

string

Function

void