PDF.js version: 3.5.141

These two properties should be marked as not mandatory as they are initialized if not present
const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
    const permissionsPromise = this.#enablePermissions
      ? pdfDocument.getPermissions()
      : Promise.resolve();
    
    
    if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {
      console.warn(
        "Forcing PAGE-scrolling for performance reasons, given the length of the document."
      );
      const mode = (this._scrollMode = ScrollMode.PAGE);
      this.eventBus.dispatch("scrollmodechanged", { source: this, mode });
    }
    this._pagesCapability.promise.then(
      () => {
        this.eventBus.dispatch("pagesloaded", { source: this, pagesCount });
      },
      () => {
        
      }
    );
    this._onBeforeDraw = evt => {
      const pageView = this._pages[evt.pageNumber - 1];
      if (!pageView) {
        return;
      }
      
      
      this.#buffer.push(pageView);
    };