> ## 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.

# PostPaginator

> X API TypeScript SDK の PostPaginator クラスのリファレンス。 Iterate paginated post results with async iterators and cursor helpers.

Paginator for posts

## 階層

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

  ↳ **`PostPaginator`**

## コンストラクター

### コンストラクター

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

Creates a new paginator instance

#### パラメーター

| 名前          | 型                                                                                                                          | 説明                                                            |
| :---------- | :------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------ |
| `fetchPage` | (`token?`: `string`) => `Promise`\<[`PaginatedResponse`](/xdks/typescript/reference/interfaces/PaginatedResponse)\<`any`>> | Function that fetches a page of data given a pagination token |

#### 戻り値

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

#### 継承元

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

#### 定義場所

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

## Accessors

### items

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

Get all fetched items

#### 戻り値

`T`\[]

#### 継承元

Paginator.items

#### 定義場所

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

***

### meta

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

Get current pagination metadata

#### 戻り値

`any`

#### 継承元

Paginator.meta

#### 定義場所

[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

#### 戻り値

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

#### 継承元

Paginator.includes

#### 定義場所

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

***

### errors

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

Get current errors

#### 戻り値

`undefined` | `any`\[]

#### 継承元

Paginator.errors

#### 定義場所

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

***

### done

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

Check if pagination is done

#### 戻り値

`boolean`

#### 継承元

Paginator.done

#### 定義場所

[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

#### 戻り値

`boolean`

#### 継承元

Paginator.rateLimited

#### 定義場所

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

***

### posts

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

#### 戻り値

`any`\[]

#### 定義場所

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

## メソッド

### 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.

#### 戻り値

`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

#### 継承元

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

#### 定義場所

[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.

#### 戻り値

`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
}
```

#### 継承元

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

#### 定義場所

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

***

### fetchPrevious

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

Fetch previous page (if supported)

#### 戻り値

`Promise`\<`void`>

#### 継承元

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

#### 定義場所

[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

#### 戻り値

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

#### 継承元

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

#### 定義場所

[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

#### パラメーター

| 名前      | 型        |
| :------ | :------- |
| `count` | `number` |

#### 戻り値

`Promise`\<`void`>

#### 継承元

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

#### 定義場所

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

***

### reset

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

Reset paginator to initial state

#### 戻り値

`void`

#### 継承元

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

#### 定義場所

[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

#### 戻り値

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

#### 継承元

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

#### 定義場所

[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

#### 戻り値

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

#### 継承元

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

#### 定義場所

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