addCommand_ (cmd) {
    if (!this.undoManager_) { return this }
    if (this.currentBatchCommand_) {
      this.currentBatchCommand_.addSubCommand(cmd)
    } else {
      this.undoManager_.addCommandToHistory(cmd)
    }
    return undefined
  }
Private function to add a command to the history or current batch command.
@private
@param {Command} cmd
@returns {module:history.HistoryRecordingService|void}