Skip to main content

Function: executeCommand()

executeCommand<T>(command, ...rest): PromiseLike<T>

Defined in: packages/extension-api/src/extension-api.d.ts:814

Execute a command, previously registered with commands.registerCommand.

For an example, see commands.

Type Parameters​

T​

T = unknown

the type of the value returned by the command

Parameters​

command​

string

the name used for registering the command

rest​

...any[]

the parameters to pass to the command

Returns​

PromiseLike<T>

the value returned by the command

Throws​

if the command is not registered

Throws​

if the command throws an exception