https://github.com/mozilla/pdf.js/blob/0df1a5661958df0c4ed2f73b0f3266d825c5c280/src/display/api.js#L710-L719
The return type signature `@returns {Promise<{num: number, gen: number}>}` is mismatched with its definition. (should be `@returns {Promise<number>}`)
this._listeners.length = 0;
  }
}
/**
 * @typedef {Object} PDFWorkerParameters
 * @property {string} [name] - The name of the worker.
 * @property {Object} [port] - The `workerPort` object.
 * @property {number} [verbosity] - Controls the logging level; the
 *   constants from {@link VerbosityLevel} should be used.
 */
const PDFWorker = (function PDFWorkerClosure() {
  const pdfWorkerPorts = new WeakMap();
  let isWorkerDisabled = false;
  let fallbackWorkerSrc;
  let nextFakeWorkerId = 0;
  let fakeWorkerCapability;
  if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC")) {
    
    if (isNodeJS && typeof __non_webpack_require__ === "function") {
      
      isWorkerDisabled = true;
      if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("LIB")) {
        fallbackWorkerSrc = "../pdf.worker.js";
      } else {
        fallbackWorkerSrc = "./pdf.worker.js";
      }
    } else if (typeof document === "object" && "currentScript" in document) {
      const pdfjsFilePath = document.currentScript?.src;
      if (pdfjsFilePath) {