CommandCollection
class
Collection of commands. Its instance is available in editor.commands.
Properties
module:core/commandcollection~CommandCollection#_commandsCommand map.
Methods
module:core/commandcollection~CommandCollection#constructorCreates collection instance.
Symbol.iterator() → Iterator<tuple>module:core/commandcollection~CommandCollection#Symbol.iteratorIterable interface.
Returns
[ commandName, commandInstance ]pairs.Returns
Iterator<tuple>
add( commandName, command ) → voidmodule:core/commandcollection~CommandCollection#addRegisters a new command.
Type parameters
TName : extends string
Parameters
commandName : TNameThe name of the command.
command : CommandsMap[ TName ]
Returns
void
module:core/commandcollection~CommandCollection#commandsdestroy() → voidmodule:core/commandcollection~CommandCollection#destroyexecute( commandName, commandParams ) → ReturnType<CommandsMap[ TName ][ 'execute' ]>module:core/commandcollection~CommandCollection#executeExecutes a command.
Type parameters
TName : extends string
Parameters
commandName : TNameThe name of the command.
commandParams : Parameters<CommandsMap[ TName ][ 'execute' ]>Command parameters.
Returns
ReturnType<CommandsMap[ TName ][ 'execute' ]>The value returned by the
command.execute().
get( commandName ) → undefined | CommandsMap[ TName ]module:core/commandcollection~CommandCollection#getRetrieves a command from the collection.
Type parameters
TName : extends string
Parameters
commandName : TNameThe name of the command.
Returns
undefined | CommandsMap[ TName ]
names() → IterableIterator<string>module:core/commandcollection~CommandCollection#names