The prebuilt files include `web/pdf_viewer.js` with some viewer APIs. Those are missing from type declarations.
const pdfFile = fs.readFileSync(dir + "/build/pdf.js").toString();
  const pdfWorkerFile = fs
    .readFileSync(dir + "/build/pdf.worker.js")
    .toString();
  const pdfSandboxFile = fs
    .readFileSync(dir + "/build/pdf.sandbox.js")
    .toString();
  const pdfImageDecodersFile = fs
    .readFileSync(dir + "/image_decoders/pdf.image_decoders.js")
    .toString();
  const viewerFiles = {
    "pdf.js": pdfFile,
    "viewer.js": fs.readFileSync(dir + "/web/viewer.js").toString(),
  };
  console.log();
  console.log("### Minifying js files");
  const Terser = require("terser");
  const options = {
    compress: {
      
      sequences: false,
    },
    keep_classnames: true,
    keep_fnames: true,
  };
  fs.writeFileSync(
    dir + "/web/pdf.viewer.js",
    (await Terser.minify(viewerFiles, options)).code
  );
  fs.writeFileSync(