https://github.com/mozilla/pdf.js/blob/0df1a5661958df0c4ed2f73b0f3266d825c5c280/src/display/api.js#L710-L719
The return type signature `@returns {Promise<{num: number, gen: number}>}` is mismatched with its definition. (should be `@returns {Promise<number>}`)
normalizeWhitespace = false,
    disableCombineTextItems = false,
    includeMarkedContent = false,
  } = {}) {
    const TEXT_CONTENT_CHUNK_SIZE = 100;
    return this._transport.messageHandler.sendWithStream(
      "GetTextContent",
      {
        pageIndex: this._pageIndex,
        normalizeWhitespace: normalizeWhitespace === true,
        combineTextItems: disableCombineTextItems !== true,
        includeMarkedContent: includeMarkedContent === true,
      },
      {
        highWaterMark: TEXT_CONTENT_CHUNK_SIZE,
        size(textContent) {
          return textContent.items.length;
        },
      }
    );
  }
  /**
   * @param {getTextContentParameters} params - getTextContent parameters.
   * @returns {Promise<TextContent>} A promise that is resolved with a
   *   {@link TextContent} object that represents the page's text content.
   */
  getTextContent(params = {}) {