# Interface: DocumentResultViewConfig

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

# Interface: DocumentResultViewConfig

Defined in: [src/views/DocumentResultView.ts:154](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentResultView.ts#L154)

The `DocumentResultViewConfig` interface passes settings to the [DocumentScanner](../classes/DocumentScanner.md) constructor through the [DocumentScannerConfig](DocumentScannerConfig.md) to apply UI and business logic customizations for the [DocumentResultView](../classes/DocumentResultView.md).

## Remarks

Only rare and edge-case scenarios require editing MDS source code. MDS uses sensible default values for all omitted properties.

## Example

```javascript
const documentScanner = new Dynamsoft.DocumentScanner({
    license: "YOUR_LICENSE_KEY_HERE", // Replace this with your actual license key
    resultViewConfig: {
        onDone: async (result) =>
        {
            const canvas = result.correctedImageResult.toCanvas();
            resultContainer.appendChild(canvas);
        }
    }
});
```

## Properties

### container?

> `optional` **container?**: `string` \| `HTMLElement`

Defined in: [src/views/DocumentResultView.ts:160](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentResultView.ts#L160)

The HTML container element or selector for the [DocumentResultView](../classes/DocumentResultView.md) UI.

***

### onDone?

> `optional` **onDone?**: (`result`) => `Promise`\<`void`\>

Defined in: [src/views/DocumentResultView.ts:176](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentResultView.ts#L176)

Handler called when the user clicks the "Done" button.

#### Parameters

##### result

[`DocumentResult`](DocumentResult.md)

The [DocumentResult](DocumentResult.md) of the scan, including the original image, corrected image, detected boundaries, and scan status

#### Returns

`Promise`\<`void`\>

***

### onUpload?

> `optional` **onUpload?**: (`result`) => `Promise`\<`void`\>

Defined in: [src/views/DocumentResultView.ts:184](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentResultView.ts#L184)

Handler called when the user clicks the "Upload" button.

#### Parameters

##### result

[`DocumentResult`](DocumentResult.md)

The [DocumentResult](DocumentResult.md) of the scan, including the original image, corrected image, detected boundaries, and scan status

#### Returns

`Promise`\<`void`\>

***

### toolbarButtonsConfig?

> `optional` **toolbarButtonsConfig?**: [`DocumentResultViewToolbarButtonsConfig`](DocumentResultViewToolbarButtonsConfig.md)

Defined in: [src/views/DocumentResultView.ts:168](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentResultView.ts#L168)

Configure the appearance and labels of the buttons for the [DocumentResultView](../classes/DocumentResultView.md) UI.

#### See

[DocumentResultViewToolbarButtonsConfig](DocumentResultViewToolbarButtonsConfig.md)
