CommandCollection (core)
@ckeditor/ckeditor5-core/src/commandcollection
Collection of commands. Its instance is available in editor.commands
.
Filtering
Properties
-
Command map.
Methods
-
constructor()
module:core/commandcollection~CommandCollection#constructor
Creates collection instance.
-
Symbol.iterator() → Iterator<tuple, any, undefined>
module:core/commandcollection~CommandCollection#Symbol.iterator
Iterable interface.
Returns
[ commandName, commandInstance ]
pairs.Returns
Iterator<tuple, any, undefined>
-
add( commandName, command ) → void
module:core/commandcollection~CommandCollection#add
Registers a new command.
Type parameters
TName : extends string
Parameters
commandName : TName
The name of the command.
command : CommandsMap[ TName ]
Returns
void
-
-
destroy() → void
module:core/commandcollection~CommandCollection#destroy
-
execute( commandName, commandParams ) → ReturnType<CommandsMap[ TName ][ 'execute' ]>
module:core/commandcollection~CommandCollection#execute
Executes a command.
Type parameters
TName : extends string
Parameters
commandName : TName
The 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#get
Retrieves a command from the collection.
Type parameters
TName : extends string
Parameters
commandName : TName
The name of the command.
Returns
undefined | CommandsMap[ TName ]
-
names() → IterableIterator<string>
module:core/commandcollection~CommandCollection#names
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.