export {Base, HTMLProgress};

/** Do nothing when receives value, max and done. */
class Base {
  /**
   * Handle current value and maximum value.
   * @param {object} valueMax An object with property valuePercentage and maxPercentage. e.g. { valuePercentage: 20, maxPercentage: 100 }
   */
  setValueMax(valueMax) {}

  /**
   * Inform the process is done.
   * @param {any} doneValue Any value.
   */
  informDone(doneValue) {}
}

/** Dummy receiver which discards all information. */
Base.dummy = new Base();

/**
 * Report progress to HTMLProgressElement.
 */
class HTMLProgress extends Base {
  /** @param {HTMLProgressElement} htmlProgress The HTMLProgressElement for reporting progress. can not null. */
  constructor(htmlProgress) {
    super();
    this.htmlProgress = htmlProgress;
  }

  /** Set HTMLProgressElement.value and HTMLProgressElement.max to valueMax.valuePercentage and valueMax.maxPercentage. */
  setValueMax(valueMax) {
    this.htmlProgress.value = valueMax.valuePercentage;
    this.htmlProgress.max = valueMax.maxPercentage;
  }

  /** Call HTMLProgressElement.onclick(). */
  informDone(doneValue) {
    this.htmlProgress.dispatchEvent(new Event("click"));
  }
}

/**
 * @param {string} htmlProgressTitle The title of HTMLProgressElement.
 * @return
 *   Return a new ProgressReceiver.HTMLProgress, if found.
 *   Return the shared ProgressReceiver.Base.dummy, If not found.
 */
HTMLProgress.createByTitle_or_getDummy = function (htmlProgressTitle) {
  if (htmlProgressTitle) {
    let htmlProgress = document.querySelector(`progress[title="${htmlProgressTitle}"]`);
    if (htmlProgress)
      return new HTMLProgress(htmlProgress);
  }
  return Base.dummy;
}

@@ -104,214 +104,287 @@
   * 
-Handle current value and maximum value.%0A   * @param %7Bobject%7D valueMax An object with property valuePercentage and maxPercentage. e.g. %7B valuePercentage: 20, maxPercentage: 100 %7D%0A   */%0A  setValueMax(valueM
+@param %7Bnumber%7D value The current value.%0A   * @param %7Bnumber%7D max   The maximum value.%0A   */%0A  setValueMax( value, max ) %7B%7D%0A%0A  /**%0A   * @param %7Bnumber%7D value The current value.%0A   */%0A  setValue( value ) %7B%7D%0A%0A  /**%0A   * @param %7Bnumber%7D max   The maximum value.%0A   */%0A  setMax( m
 ax
+ 
 ) %7B%7D
@@ -1121,24 +1121,629 @@
 ntage;%0A  %7D%0A%0A
+  /**%0A   * Set HTMLProgressElement.value and HTMLProgressElement.max to value and max.%0A   * @param %7Bnumber%7D value The current value.%0A   * @param %7Bnumber%7D max   The maximum value.%0A   */%0A  setValueMax( value, max ) %7B%0A    this.htmlProgress.value = value;%0A    this.htmlProgress.max = max;%0A  %7D%0A%0A  /**%0A   * Set HTMLProgressElement.value to value.%0A   * @param %7Bnumber%7D value The current value.%0A   */%0A  setValue( value ) %7B%0A    this.htmlProgress.value = value;%0A  %7D%0A%0A  /**%0A   * HTMLProgressElement.max max.%0A   * @param %7Bnumber%7D max   The maximum value.%0A   */%0A  setMax( max ) %7B%0A    this.htmlProgress.max = max;%0A  %7D%0A%0A
   /** Call H

Update Receiver.js