input-terminal
    Preparing search index...

    Manages the list of commands that can be executed by a terminal.

    Index

    Constructors

    Accessors

    • get list(): Command[]

      Get the list of commands in the terminal's bin.

      Returns Command[]

    • set list(commands: Command[]): void

      Set the list of commands in the terminal's bin.

      Parameters

      Returns void

      if any command in the list has a key that already exists

    • get emptyCommand(): Command

      Get the command that is executed when empty input is provided.

      Returns Command

    • set emptyCommand(command: Command): void

      Set the command that is executed when empty input is provided.

      Parameters

      Returns void

    Methods

    • Retrieves a list of keys for all commands in the terminal's bin.

      Returns string[]

      a list of the keys of all commands in the terminal's bin

    • Finds a command by its key in the terminal's bin.

      Parameters

      • OptionalcommandKey: string

        the key of the command to find

      Returns undefined | Command

      the command with the given key; undefined if the command is not found or if no key is provided

    • Adds a command (or list of commands) to the terminal's bin.

      Parameters

      • commands: Command | Command[]

        the command (or list of commands) to add to the terminal's bin

      Returns number

      the new length of the command list

      an error if a command with the same key already exists

    • Removes a command from the terminal's command list.

      Parameters

      • command: Command

        the command to remove

      Returns undefined | Command

      the removed command; undefined if the command is not found