Stage
A class impementing the Stages SDK
Extends
TypedEmitter
<StageEventMap
>
Constructors
new Stage()
new Stage(
token
,strategy
):Stage
Creates an instance of a Stage
Parameters
Parameter | Type | Description |
---|---|---|
token | string | The token to join this stage as |
strategy | StageStrategy | The StageStrategy to use for this Stage |
Returns
Overrides
TypedEmitter<StageEventMap>.constructor
Methods
join()
join():
Promise
<void
>
Joins the stage
Returns
Promise
<void
>
leave()
leave():
void
Leaves the stage
Returns
void
off()
off<
Event
>(event
,callback
,context
?):void
Deregister a new callback based on the event provided. The events enum is either linked in the EventMap type or in the root of the class.
Type Parameters
Type Parameter |
---|
Event extends keyof StageEventMap |
Parameters
Parameter | Type | Description |
---|---|---|
event | Event | the event to de-register the callback for |
callback | StageEventMap [Event ] | the callback to be de-registered |
context ? | any | - |
Returns
void
Inherited from
TypedEmitter.off
on()
on<
Event
>(event
,callback
,context
?):void
Register a new callback based on the event provided. The events enum is either linked in the EventMap type or in the root of the class.
Type Parameters
Type Parameter |
---|
Event extends keyof StageEventMap |
Parameters
Parameter | Type | Description |
---|---|---|
event | Event | the event to register the callback for |
callback | StageEventMap [Event ] | the callback to be invoked for the event |
context ? | any | - |
Returns
void
Inherited from
TypedEmitter.on
refreshStrategy()
refreshStrategy():
void
Re-executes the StageStrategy
Returns
void
replaceStrategy()
replaceStrategy(
strategy
):void
Updates and re-executes the StageStrategy
Parameters
Parameter | Type | Description |
---|---|---|
strategy | StageStrategy | The new StageStrategy for the stage |