PDF.js version: 3.5.141

These two properties should be marked as not mandatory as they are initialized if not present
const savedCursor = this.container.style.cursor;
      this.container.style.cursor = "wait";
      const interruptCopy = ev =>
        (this.#interruptCopyCondition = ev.key === "Escape");
      window.addEventListener("keydown", interruptCopy);
      this.getAllText()
        .then(async text => {
          if (text !== null) {
            await navigator.clipboard.writeText(text);
          }
        })
        .catch(reason => {
          console.warn(
            `Something goes wrong when extracting the text: ${reason.message}`
          );
        })
        .finally(() => {
          this.#getAllTextInProgress = false;
          this.#interruptCopyCondition = false;
          window.removeEventListener("keydown", interruptCopy);
          this.container.style.cursor = savedCursor;
        });
      event.preventDefault();
      event.stopPropagation();
    }
  }
  /**
   * @param {PDFDocumentProxy} pdfDocument
   */
  setDocument(pdfDocument) {