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>}`)
if (callback) {
      this._ensureObj(objId).capability.promise.then(callback);
      return null;
    }
    
    
    const obj = this._objs[objId];
    
    
    if (!obj || !obj.resolved) {
      throw new Error(`Requesting object that isn't resolved yet ${objId}.`);
    }
    return obj.data;
  }
  has(objId) {
    const obj = this._objs[objId];
    return obj?.resolved || false;
  }
  /**
   * Resolves the object `objId` with optional `data`.
   */
  resolve(objId, data) {
    const obj = this._ensureObj(objId);
    obj.resolved = true;
    obj.data = data;
    obj.capability.resolve(data);
  }
  clear() {