CommandCollection (core)
@ckeditor/ckeditor5-core/src/commandcollection
Collection of commands. Its instance is available in editor.commands
.
Filtering
Properties
-
_commands : Map
module:core/commandcollection~CommandCollection#_commands
private
Command map.
Methods
-
constructor()
module:core/commandcollection~CommandCollection#constructor
Creates collection instance.
-
Symbol.iterator() → Iterable.<Array>
module:core/commandcollection~CommandCollection#Symbol.iterator
Iterable interface.
Returns
[ commandName, commandInstance ]
pairs.Returns
Iterable.<Array>
-
add( commandName, command )
module:core/commandcollection~CommandCollection#add
Registers a new command.
Parameters
commandName : String
The name of the command.
command : Command
-
Returns iterator of command instances.
Returns
Iterable.<Command>
-
destroy()
module:core/commandcollection~CommandCollection#destroy
Destroys all collection commands.
-
execute( commandName, [ ...commandParams ] ) → *
module:core/commandcollection~CommandCollection#execute
Executes a command.
Parameters
commandName : String
The name of the command.
[ ...commandParams ] : *
Command parameters.
Returns
*
The value returned by the
command.execute()
.
-
Retrieves a command from the collection.
-
names() → Iterable.<String>
module:core/commandcollection~CommandCollection#names
Returns iterator of command names.
Returns
Iterable.<String>
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.