Show:
Extends EndPoint

Provides access to Cantabile's UI commands

Access this object via the commands property.

Methods

availableCommands () Promise | CommandInfo[][]

Defined in Commands.js:31

Retrieves a list of available commands

If Cantabile is running on your local machine you can view this list directly at http://localhost:35007/api/commands/availableCommands

Returns:

Promise | CommandInfo[][]:

A promise to return an array of CommandInfo

Example:

let C = new CantabileApi();
C.connect();
console.log(await C.commands.availableCommands());
close ()

Inherited from EndPoint: EndPoint.js:55

Closes the end point and stops listening for events. This method no longer needs to be explicitly called as end points are now automatically closed when the last event listener is removed.
invoke
(
  • id
)
Promise

Defined in Commands.js:52

Invokes a command

Parameters:

  • id String

    The id of the command to invoke

Returns:

Promise:

A promise that resolves once the target command has been invoked

Example:

Show the file open dialog

C.commands.invoke("file.open");
open ()

Inherited from EndPoint: EndPoint.js:35

Opens this end point and starts listening for events. This method no longer needs to be explicitly called as end points are now automatically opened when the first event listener is attached. Use this method to keep the end point open even when no event listeners are attached.
untilOpen () Promise

Inherited from EndPoint: EndPoint.js:137

Returns a promise that will be resolved when this end point is opened

Returns:

Promise

Example:

let C = new CantabileApi();
   C.application.open();
await C.application.untilOpen();