registerCommand

fun registerCommand(command: String, callback: () -> Unit, thisArg: JsAny? = definedExternally): Disposable(source)

Registers a command that can be invoked via a keyboard shortcut, a menu item, an action, or directly.

Registering a command with an existing command identifier twice will cause an error.

Parameters

command

A unique identifier for the command.

callback

A command handler function.

thisArg

The this context used when invoking the handler function.