addRoutes(routeDefn) {
    if (!Array.isArray(routeDefn))
      routeDefn = [routeDefn];
    this._normaliseRouteDefns(routeDefn);
    this.config.routes.push(...routeDefn);
    this._updateRouteIds();
    document.dispatchEvent(new CustomEvent("uibrouter:routes-added", { detail: routeDefn }));
    if (this.uibuilder)
      uibuilder.set("uibrouter", "routes added");
    if (this.config.templateLoadAll) {
      Promise.allSettled(Object.values(routeDefn).filter((r) => r.type && r.type === "url").map(this._loadExternal)).then((results) => {
        results.filter((res) => res.status === "rejected").forEach((res) => {
          console.error(res.reason);
        });
        this.config.routes.push(...routeDefn);
        this._updateRouteIds();
        document.dispatchEvent(new CustomEvent("uibrouter:routes-added", { detail: routeDefn }));
        if (this.uibuilder)
          uibuilder.set("uibrouter", "routes added");
        return true;
      }).catch((reason) => {
        console.error(reason);
      });
    }
  }
Add new route definitions to the existing ones
@param {routeDefinition|routeDefinition[]} routeDefn Single or array of route definitions to add