Mobile Document Scanner API Reference / DocumentChange
Type Alias: DocumentChange
DocumentChange = {
pages: readonlyScannedPage[];state:DocumentState;type:"pagesAdded"; } | {indices: readonlynumber[];state:DocumentState;type:"pagesRemoved"; } | {state:DocumentState;type:"pagesReordered"; } | {page:ScannedPage;state:DocumentState;type:"pageEdited"; } | {state:DocumentState;type:"historyChanged"; }
Defined in: src/results.ts:172
A change to the document, and the state after it, which the 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[]; state: DocumentState; type: "pagesAdded"; }
Pages came into the document: new ones, or ones that undo or redo brought back.
Type Literal
{ indices: readonly number[]; state: DocumentState; type: "pagesRemoved"; }
Pages left the document, from the indices they had.
Type Literal
{ state: DocumentState; type: "pagesReordered"; }
The pages changed their order.
Type Literal
{ page: ScannedPage; state: DocumentState; type: "pageEdited"; }
A page turned, or took a new boundary or filter.
Type Literal
{ state: DocumentState; type: "historyChanged"; }
What undo and redo can do changed.