> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UserPaginator

> Referência para a classe UserPaginator no SDK TypeScript da X API. Itere resultados paginados de user com iteradores assíncronos e utilitários de cursor.

Paginator for users

## Hierarquia

* [`Paginator`](/xdks/typescript/reference/classes/Paginator)\<`any`>

  ↳ **`UserPaginator`**

## Construtores

### constructor

• **new UserPaginator**(`fetchPage`): [`UserPaginator`](/xdks/typescript/reference/classes/UserPaginator)

Creates a new paginator instance

#### Parâmetros

| Nome        | Tipo                                                                                                                       | Descrição                                                     |
| :---------- | :------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------ |
| `fetchPage` | (`token?`: `string`) => `Promise`\<[`PaginatedResponse`](/xdks/typescript/reference/interfaces/PaginatedResponse)\<`any`>> | Function that fetches a page of data given a pagination token |

#### Retorna

[`UserPaginator`](/xdks/typescript/reference/classes/UserPaginator)

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[constructor](/xdks/typescript/reference/classes/Paginator#constructor)

#### Definido em

[paginator.ts:90](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L90)

## Acessadores

### items

• `get` **items**(): `T`\[]

Get all fetched items

#### Retorna

`T`\[]

#### Herdado de

Paginator.items

#### Definido em

[paginator.ts:97](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L97)

***

### meta

• `get` **meta**(): `any`

Get current pagination metadata

#### Retorna

`any`

#### Herdado de

Paginator.meta

#### Definido em

[paginator.ts:104](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L104)

***

### includes

• `get` **includes**(): `undefined` | `Record`\<`string`, `any`>

Get current includes data

#### Retorna

`undefined` | `Record`\<`string`, `any`>

#### Herdado de

Paginator.includes

#### Definido em

[paginator.ts:111](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L111)

***

### errors

• `get` **errors**(): `undefined` | `any`\[]

Get current errors

#### Retorna

`undefined` | `any`\[]

#### Herdado de

Paginator.errors

#### Definido em

[paginator.ts:118](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L118)

***

### done

• `get` **done**(): `boolean`

Check if pagination is done

#### Retorna

`boolean`

#### Herdado de

Paginator.done

#### Definido em

[paginator.ts:125](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L125)

***

### rateLimited

• `get` **rateLimited**(): `boolean`

Check if rate limit was hit

#### Retorna

`boolean`

#### Herdado de

Paginator.rateLimited

#### Definido em

[paginator.ts:132](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L132)

***

### users

• `get` **users**(): `any`\[]

#### Retorna

`any`\[]

#### Definido em

[paginator.ts:351](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L351)

## Métodos

### fetchNext

▸ **fetchNext**(): `Promise`\<`void`>

Fetch the next page and add items to current instance

This method fetches the next page of data and appends the items to the
current paginator instance. It updates the pagination state and metadata.

#### Retorna

`Promise`\<`void`>

**`Example`**

```typescript theme={null}
const followers = await client.users.getFollowers('783214');
await followers.fetchNext(); // Fetch first page
console.log(followers.items.length); // Number of followers

if (!followers.done) {
  await followers.fetchNext(); // Fetch second page
  console.log(followers.items.length); // Total followers across pages
}
```

**`Throws`**

When the API request fails

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[fetchNext](/xdks/typescript/reference/classes/Paginator#fetchnext)

#### Definido em

[paginator.ts:156](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L156)

***

### next

▸ **next**(): `Promise`\<[`Paginator`](/xdks/typescript/reference/classes/Paginator)\<`any`>>

Get next page as a new instance

This method creates a new paginator instance that starts from the next page,
without affecting the current paginator's state.

#### Retorna

`Promise`\<[`Paginator`](/xdks/typescript/reference/classes/Paginator)\<`any`>>

New paginator instance for the next page

**`Example`**

```typescript theme={null}
const followers = await client.users.getFollowers('783214');
await followers.fetchNext(); // Fetch first page

if (!followers.done) {
  const nextPage = await followers.next(); // Get next page as new instance
  console.log(followers.items.length); // Still first page
  console.log(nextPage.items.length); // Second page
}
```

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[next](/xdks/typescript/reference/classes/Paginator#next)

#### Definido em

[paginator.ts:211](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L211)

***

### fetchPrevious

▸ **fetchPrevious**(): `Promise`\<`void`>

Fetch previous page (if supported)

#### Retorna

`Promise`\<`void`>

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[fetchPrevious](/xdks/typescript/reference/classes/Paginator#fetchprevious)

#### Definido em

[paginator.ts:225](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L225)

***

### previous

▸ **previous**(): `Promise`\<[`Paginator`](/xdks/typescript/reference/classes/Paginator)\<`any`>>

Get previous page as a new instance

#### Retorna

`Promise`\<[`Paginator`](/xdks/typescript/reference/classes/Paginator)\<`any`>>

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[previous](/xdks/typescript/reference/classes/Paginator#previous)

#### Definido em

[paginator.ts:260](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L260)

***

### fetchLast

▸ **fetchLast**(`count`): `Promise`\<`void`>

Fetch up to a specified number of additional items

#### Parâmetros

| Nome    | Tipo     |
| :------ | :------- |
| `count` | `number` |

#### Retorna

`Promise`\<`void`>

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[fetchLast](/xdks/typescript/reference/classes/Paginator#fetchlast)

#### Definido em

[paginator.ts:274](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L274)

***

### reset

▸ **reset**(): `void`

Reset paginator to initial state

#### Retorna

`void`

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[reset](/xdks/typescript/reference/classes/Paginator#reset)

#### Definido em

[paginator.ts:288](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L288)

***

### \[iterator]

▸ **\[iterator]**(): `Iterator`\<`any`, `any`, `undefined`>

Iterator for all fetched items

#### Retorna

`Iterator`\<`any`, `any`, `undefined`>

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[\[iterator\]](/xdks/typescript/reference/classes/Paginator#iterator)

#### Definido em

[paginator.ts:303](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L303)

***

### \[asyncIterator]

▸ **\[asyncIterator]**(): `AsyncIterator`\<`any`, `any`, `undefined`>

Async iterator that fetches pages automatically

#### Retorna

`AsyncIterator`\<`any`, `any`, `undefined`>

#### Herdado de

[Paginator](/xdks/typescript/reference/classes/Paginator).[\[asyncIterator\]](/xdks/typescript/reference/classes/Paginator#asynciterator)

#### Definido em

[paginator.ts:312](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/paginator.ts#L312)
