# Interface: ScannerEvents

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

# Interface: ScannerEvents

Defined in: [src/flow/events.ts:12](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/flow/events.ts#L12)

The events of the document scanner, by name, with the payload of each. Listen
with [on()](../classes/DocumentScanner.md#on).

## Properties

### documentChange

> **documentChange**: [`DocumentChange`](../type-aliases/DocumentChange.md)

Defined in: [src/flow/events.ts:18](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/flow/events.ts#L18)

A change to the document: pages came in, went out, or moved, a page changed, or
what undo and redo can do changed. Each change carries the state of
the document after it.

***

### done

> **done**: [`SuccessfulScan`](SuccessfulScan.md)

Defined in: [src/flow/events.ts:26](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/flow/events.ts#L26)

The success of a session. The document scanner waits for the listeners before
it closes its screens and before [scan()](../classes/DocumentScanner.md#scan)
resolves. Thus the host application can act on the result while the screens
still show. The event fires once in each session, and not for a cancel or a
failure.

***

### error

> **error**: [`ScannerError`](../type-aliases/ScannerError.md)

Defined in: [src/flow/events.ts:31](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/flow/events.ts#L31)

The failure of a session, with its reason. The event fires once, before
[scan()](../classes/DocumentScanner.md#scan) resolves.

***

### navigate

> **navigate**: [`Navigation`](../type-aliases/Navigation.md)

Defined in: [src/flow/events.ts:36](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/flow/events.ts#L36)

A move of the user to another screen or mode, or an overlay that opened or
closed.
