Report an issue
Class

CommandCollection (core)

@ckeditor/ckeditor5-core/src/commandcollection

class

Collection of commands. Its instance is available in editor.commands.

Filtering

Properties

Methods

  • Creates collection instance.

  • Symbol.iterator() → Iterable.<Array>

    Iterable interface.

    Returns [ commandName, commandInstance ] pairs.

    Returns

    Iterable.<Array>
  • add( commandName, command )

    Registers a new command.

    Parameters

    commandName : String

    The name of the command.

    command : Command
  • commands() → Iterable.<Command>

    Returns iterator of command instances.

    Returns

    Iterable.<Command>
  • Destroys all collection commands.

  • execute( commandName )

    Executes a command.

    Parameters

    commandName : String

    The name of the command.

  • get( commandName ) → Command

    Retrieves a command from the collection.

    Parameters

    commandName : String

    The name of the command.

    Returns

    Command
  • names() → Iterable.<String>

    Returns iterator of command names.

    Returns

    Iterable.<String>