Interface

CommandsMap (core)

@ckeditor/ckeditor5-core/src/commandcollection

interface

Helper type that maps command names to their types. It is meant to be extended with module augmentation.

class MyCommand extends Command {
	public execute( parameter: A ): B {
		// ...
	}
}

declare module '@ckeditor/ckeditor5-core' {
	interface CommandsMap {
		myCommand: MyCommand;
	}
}

// Returns `MyCommand | undefined`.
const myCommand = editor.commands.get( 'myCommand' );

// Expects `A` type as parameter and returns `B`.
const value = editor.commands.execute( 'myCommand', new A() );

Filtering

Properties