Skip to main content

CommandHistory

Classes​

CommandHistory​

History of executed commands.

Implements​

Constructors​

Constructor​
new CommandHistory(size?): CommandHistory;
Parameters​
ParameterType
size?number
Returns​

CommandHistory

Methods​

addCommand()​
addCommand(command): void;

Adds the executed command to history.

Parameters​
ParameterTypeDescription
commandICommandexecuted command.
Returns​

void

Implementation of​

ICommandHistory.addCommand

clearHistory()​
clearHistory(): void;

Clears the history of executed commands.

Returns​

void

Implementation of​

ICommandHistory.clearHistory

getCommandsCount()​
getCommandsCount(): number;

Returns the number of commands in history.

Returns​

number

Implementation of​

ICommandHistory.getCommandsCount

getLastCommand()​
getLastCommand(index?): ICommand;

Returns the last command executed from history by index.

Parameters​
ParameterTypeDescription
index?numbercommand index ('0' used for the most recent command).
Returns​

ICommand

Implementation of​

ICommandHistory.getLastCommand

Was this page helpful?