Interface Command

A command is produced and executed in reaction of a user interaction. It follows the command design pattern. It contains statements to execute to perform the command. The interface Undoable can be used to add undo/redo features to a command.

interface Command {
    canExecute(): boolean;
    cancel(): void;
    done(): void;
    execute(): boolean | Promise<boolean>;
    flush(): void;
    getStatus(): CmdStatus;
    hadEffect(): boolean;
    isDone(): boolean;
}

Implemented by

Methods

  • Checks whether the command can be executed.

    Returns boolean

    True if the command can be executed.

  • Marks the command as "done" and sends it to the command registry.

    Returns void

  • Executes (if possible) the commands.

    Returns boolean | Promise<boolean>

    True: the command has been executed.

  • Flushes the UI command. The command must not be used after that.

    Returns void

  • State whether the execution of this command has effects on the system.

    Returns boolean

    True: the command has effects on the system.

  • To know whether the command has been marked as 'done'.

    Returns boolean

    True: the command has been marked as 'done'.

Generated using TypeDoc