canvasMaxAreaInBytes in DocumentInitParameters has type Boolean, preventing TypeScript users from passing the correct (numeric) value.
if (
    typeof PDFJSDev !== "undefined" &&
    PDFJSDev.test("GENERIC") &&
    isNodeJS &&
    typeof Buffer !== "undefined" && 
    val instanceof Buffer 
  ) {
    deprecated(
      "Please provide binary data as `Uint8Array`, rather than `Buffer`."
    );