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 memoryscene-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.
Extends
Section titled “Extends”EventEmitter
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SourcePluginWindow():
SourcePluginWindow
Defined in: window/source.ts:49
** For Deprecation
Use getInstance()
Returns
Section titled “Returns”SourcePluginWindow
Overrides
Section titled “Overrides”EventEmitter.constructor
Properties
Section titled “Properties”_proxyHandlers
Section titled “_proxyHandlers”
static_proxyHandlers:object={}
Defined in: util/eventemitter.ts:7
Inherited from
Section titled “Inherited from”EventEmitter._proxyHandlers
_remoteHandlers
Section titled “_remoteHandlers”
static_remoteHandlers:object={}
Defined in: util/eventemitter.ts:6
Inherited from
Section titled “Inherited from”EventEmitter._remoteHandlers
_subscriptions
Section titled “_subscriptions”
static_subscriptions:string[] =[]
Defined in: window/source.ts:29
Methods
Section titled “Methods”emit()
Section titled “emit()”emit(
event, …params):void
Defined in: util/eventemitter.ts:66
This function lets an event trigger with any number of supplied parameters.
Parameters
Section titled “Parameters”string
params
Section titled “params”…any[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EventEmitter.emit
off(
event,handler):void
Defined in: util/eventemitter.ts:37
This function removes a handler to an event.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”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.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”Function
string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EventEmitter.on
_finalCallback()
Section titled “_finalCallback()”
static_finalCallback(message):Promise<void>
Defined in: util/eventemitter.ts:99
Parameters
Section titled “Parameters”message
Section titled “message”string
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”EventEmitter._finalCallback
_setCallback()
Section titled “_setCallback()”
static_setCallback(message):Promise<unknown>
Defined in: util/eventemitter.ts:90
Parameters
Section titled “Parameters”message
Section titled “message”string
Returns
Section titled “Returns”Promise<unknown>
Inherited from
Section titled “Inherited from”EventEmitter._setCallback
emit()
Section titled “emit()”
staticemit(event, …params):void
Defined in: window/source.ts:73
param: (event: string, …params: any[])
Allows this class to emit an event.
Parameters
Section titled “Parameters”string
params
Section titled “params”…any[]
Returns
Section titled “Returns”void
getInstance()
Section titled “getInstance()”
staticgetInstance():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.
Returns
Section titled “Returns”SourcePluginWindow
staticoff(event,handler):void
Defined in: window/source.ts:115
Parameters
Section titled “Parameters”string
handler
Section titled “handler”Function
Returns
Section titled “Returns”void
staticon(event,handler):void
Defined in: window/source.ts:88
param: (event: string, handler: Function)
Allows listening to events that this class emits.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”Function
Returns
Section titled “Returns”void