canvasMaxAreaInBytes in DocumentInitParameters has type Boolean, preventing TypeScript users from passing the correct (numeric) value.
let createPDFNetworkStream;
if (typeof PDFJSDev === "undefined") {
  const streamsPromise = Promise.all([
    import("./network.js"),
    import("./fetch_stream.js"),
  ]);
  createPDFNetworkStream = async params => {
    const [{ PDFNetworkStream }, { PDFFetchStream }] = await streamsPromise;
    return isValidFetchUrl(params.url)
      ? new PDFFetchStream(params)
      : new PDFNetworkStream(params);
  };
} else if (PDFJSDev.test("GENERIC || CHROME")) {
  if (PDFJSDev.test("GENERIC") && isNodeJS) {
    const { PDFNodeStream } = require("./node_stream.js");
    createPDFNetworkStream = params => {
      return new PDFNodeStream(params);
    };
  } else {
    const { PDFNetworkStream } = require("./network.js");
    const { PDFFetchStream } = require("./fetch_stream.js");
    createPDFNetworkStream = params => {
      return isValidFetchUrl(params.url)
        ? new PDFFetchStream(params)
        : new PDFNetworkStream(params);
    };
  }
}
/**
 * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |