# Type Alias: DocumentChange

[Mobile Document Scanner API Reference](../index.md) / DocumentChange

# Type Alias: DocumentChange

> **DocumentChange** = \{ `pages`: readonly [`ScannedPage`](../interfaces/ScannedPage.md)[]; `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pagesAdded"`; \} \| \{ `indices`: readonly `number`[]; `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pagesRemoved"`; \} \| \{ `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pagesReordered"`; \} \| \{ `page`: [`ScannedPage`](../interfaces/ScannedPage.md); `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pageEdited"`; \} \| \{ `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"historyChanged"`; \}

Defined in: [src/results.ts:172](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/results.ts#L172)

A change to the document, and the state after it, which the
[documentChange](../interfaces/ScannerEvents.md#documentchange) event reports. A minor
release may add a `type`, so a switch on `type` needs a default branch.

## Union Members

### Type Literal

\{ `pages`: readonly [`ScannedPage`](../interfaces/ScannedPage.md)[]; `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pagesAdded"`; \}

Pages came into the document: new ones, or ones that undo or redo brought back.

***

### Type Literal

\{ `indices`: readonly `number`[]; `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pagesRemoved"`; \}

Pages left the document, from the indices they had.

***

### Type Literal

\{ `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pagesReordered"`; \}

The pages changed their order.

***

### Type Literal

\{ `page`: [`ScannedPage`](../interfaces/ScannedPage.md); `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"pageEdited"`; \}

A page turned, or took a new boundary or filter.

***

### Type Literal

\{ `state`: [`DocumentState`](../interfaces/DocumentState.md); `type`: `"historyChanged"`; \}

What undo and redo can do changed.
