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

# Module: framework

> Reference for the bijection/framework entry point.

## Classes

* [PageFillController](https://docs.bijection.com/api/classes/framework.PageFillController.md)
* [StepDriver](https://docs.bijection.com/api/classes/framework.StepDriver.md)

## Type Aliases

### PageSegment

Ƭ **PageSegment**: `Object`

One read of a page: where it starts and how many objects it asks for, and
where it ends once pinned ([pinSegments](https://docs.bijection.com/api/modules/framework#pinsegments)).
A page is one or more segments, each starting at the previous one's cursor.

#### Type declaration

| Name | Type |
| :- | :- |
| `cursor` | `string` \| `null` |
| `numItems` | `number` |
| `endCursor?` | `string` |

***

### FilledPage

Ƭ **FilledPage**: [`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) & \{ `segments`: `number` ; `filling`: `boolean` ; `stalled`: `boolean`  }

A page joined from its segments, as one [AppPage](https://docs.bijection.com/api/modules/apps#apppage).

***

### StepDriverState

Ƭ **StepDriverState**: `Object`

Cursor-fenced execution driven by reactive inputs. Close pauses between steps.

#### Type declaration

| Name | Type |
| :- | :- |
| `busy` | `boolean` |
| `error` | `unknown` |

## Variables

### FILL\_SEGMENTS

• `Const` **FILL\_SEGMENTS**: `8`

Segments a page reads on its own before it asks to continue: a highly
selective filter over a large checked collection stops here and says so,
rather than issuing reads without end.

## Functions

### validateBranchResponse

▸ **validateBranchResponse**(`endpoint`, `value`, `request`): `void`

#### Parameters

| Name | Type |
| :- | :- |
| `endpoint` | `string` |
| `value` | `unknown` |
| `request` | `Record`\<`string`, `unknown`> |

#### Returns

`void`

***

### joinSegments

▸ **joinSegments**(`results`, `pageSize`): [`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) & \{ `rows`: `number`  } | `undefined`

The page the segments read so far make, or undefined until each has
answered.

Segments partition the range: each starts at its predecessor's cursor, and
a reactive page keeps its end position after its first answer, so their
concatenation neither repeats nor skips an object at the client's one
snapshot. The page ends as its last segment does, except that a page that
filled (`pageSize` objects or more) ends as `page`.

#### Parameters

| Name | Type |
| :- | :- |
| `results` | readonly ([`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) \| `undefined`)\[] |
| `pageSize` | `number` |

#### Returns

[`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) & \{ `rows`: `number`  } | `undefined`

***

### nextSegment

▸ **nextSegment**(`segments`, `results`, `pageSize`, `limit`): [`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment) | `null`

The segment to read next for a page of `pageSize`, or null: only after the
last segment has answered, only while it ended at its read bound
(`budget`) with the page still short, and only within `limit` segments. It
asks for exactly the objects still missing.

#### Parameters

| Name | Type |
| :- | :- |
| `segments` | readonly [`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment)\[] |
| `results` | readonly ([`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) \| `undefined`)\[] |
| `pageSize` | `number` |
| `limit` | `number` |

#### Returns

[`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment) | `null`

***

### pinSegments

▸ **pinSegments**(`segments`, `results`): [`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment)\[] | `null`

The segments with each answered segment listed in a spatial index's order
(`order: "index"`) pinned to end where its first answer ended, or null
when none needs pinning. A native page keeps its end on re-runs by itself;
an index-order page keeps it only when asked with its end cursor, so an
object written before its end never shifts it into the next segment.

#### Parameters

| Name | Type |
| :- | :- |
| `segments` | readonly [`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment)\[] |
| `results` | readonly ([`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) \| `undefined`)\[] |

#### Returns

[`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment)\[] | `null`

***

### isStalled

▸ **isStalled**(`segments`, `results`, `pageSize`, `limit`): `boolean`

Whether the joined page stopped continuing on its own while short.

#### Parameters

| Name | Type |
| :- | :- |
| `segments` | readonly [`PageSegment`](https://docs.bijection.com/api/modules/framework#pagesegment)\[] |
| `results` | readonly ([`AppPage`](https://docs.bijection.com/api/modules/apps#apppage) \| `undefined`)\[] |
| `pageSize` | `number` |
| `limit` | `number` |

#### Returns

`boolean`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.