canvasMaxAreaInBytes in DocumentInitParameters has type Boolean, preventing TypeScript users from passing the correct (numeric) value.
if (
          typeof PDFJSDev !== "undefined" &&
          PDFJSDev.test("GENERIC") &&
          !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)
        ) {
          workerSrc = PDFWorkerUtil.createCDNWrapper(
            new URL(workerSrc, window.location).href
          );
        }
        const worker =
          typeof PDFJSDev === "undefined" &&
          !workerSrc.endsWith("/build/pdf.worker.js")
            ? new Worker(workerSrc, { type: "module" })
            : new Worker(workerSrc);
        const messageHandler = new MessageHandler("main", "worker", worker);
        const terminateEarly = () => {
          worker.removeEventListener("error", onWorkerError);
          messageHandler.destroy();
          worker.terminate();
          if (this.destroyed) {
            this._readyCapability.reject(new Error("Worker was destroyed"));
          } else {
            
            
            this._setupFakeWorker();
          }
        };
        const onWorkerError = () => {