Class: Broadcast<MoreMessageTypes, T>
commands.Broadcast
Type parameters
Name | Type |
---|---|
MoreMessageTypes | extends Record <string , unknown > = Record <string , unknown > |
T | extends keyof AllServerMessageTypes <MoreMessageTypes > = keyof AllServerMessageTypes <MoreMessageTypes > |
Hierarchy
↳
Broadcast
Constructors
constructor
• new Broadcast<MoreMessageTypes
, T
>(type
, message?
)
Type parameters
Name | Type |
---|---|
MoreMessageTypes | extends Record <string , unknown > = Record <string , unknown > |
T | extends string | number | symbol = keyof ServerMessageTypes | keyof MoreMessageTypes |
Parameters
Name | Type |
---|---|
type | T |
message? | AllServerMessageTypes <MoreMessageTypes >[T ] |
Overrides
Properties
message
• message: AllServerMessageTypes
<MoreMessageTypes
>[T
]
type
• type: T
Accessors
name
• get
name(): string
Returns
string
Inherited from
Command.name
Methods
execute
▸ execute(state
, room
): Promise
<void
>
Parameters
Name | Type |
---|---|
state | State <Record <string , unknown >> |
room | Room <any , MoreMessageTypes > |
Returns
Promise
<void
>
Overrides
subExecute
▸ Protected
subExecute(state
, room
, command
): Promise
<void
>
Execute a sub command.
Call ONLY during your commands execute
method.
Will also remember it internally for undoing.
Parameters
Name | Type |
---|---|
state | State <Record <string , unknown >> |
room | Room <State <Record <string , unknown >>, Record <string , unknown >> |
command | Command <State <Record <string , unknown >>> |
Returns
Promise
<void
>
Inherited from
undo
▸ undo(state
, room
): Promise
<void
>
Undoes every remembered extra sub command.
Command
may gather new sub commands only while executing.
Sequence
will only gather sub commands upon construction.
Parameters
Name | Type |
---|---|
state | State <Record <string , unknown >> |
room | Room <any , MoreMessageTypes > |
Returns
Promise
<void
>