# documentScan
Documentation: [Chrome Document Scan API](https://developer.chrome.com/docs/extensions/reference/documentScan)
A promise-based wrapper for the Chrome `documentScan` API.
## Methods
- [cancelDocScanning(job)](#cancelDocScanning)
- [closeDocScanner(scannerHandle)](#closeDocScanner)
- [getDocScannerOptionGroups(scannerHandle)](#getDocScannerOptionGroups)
- [getDocScannerList(filter)](#getDocScannerList)
- [openDocScanner(scannerId)](#openDocScanner)
- [readDocScanningData(job)](#readDocScanningData)
- [docScanning(options)](#docScanning)
- [setDocScannerOptions(scannerHandle, options)](#setDocScannerOptions)
- [startDocScanning(scannerHandle, options)](#startDocScanning)
---
### cancelDocScanning
```
cancelDocScanning(job: string): Promise>
```
Cancels an ongoing document scan job.
### closeDocScanner
```
closeDocScanner(scannerHandle: string): Promise>
```
Closes the document scanner associated with the specified scanner handle.
### getDocScannerOptionGroups
```
getDocScannerOptionGroups(scannerHandle: string): Promise>
```
Retrieves the available option groups for the specified document scanner.
### getDocScannerList
```
getDocScannerList(filter: chrome.documentScan.DeviceFilter): Promise
```
Fetches a list of document scanners matching the given filter criteria.
### openDocScanner
```
openDocScanner(scannerId: string): Promise>
```
Opens a document scanner by its ID, returning a handle for further operations.
### readDocScanningData
```
readDocScanningData(job: string): Promise>
```
Reads the next chunk of data from an ongoing scan job. Note: A successful response with zero-length data indicates the scanner is still working; try again shortly. When the job completes, the response `result` will be `EOF` and may contain a final data chunk.
### docScanning
```
docScanning(options: chrome.documentScan.ScanOptions): Promise
```
Performs a one-shot document scan with the specified options and returns the results.
### setDocScannerOptions
```
setDocScannerOptions(
scannerHandle: string,
options: chrome.documentScan.OptionSetting[]
): Promise>
```
Sets multiple scanner options on the given scanner handle.
### startDocScanning
```
startDocScanning(
scannerHandle: string,
options: chrome.documentScan.StartScanOptions
): Promise>
```
Starts a scan on an open scanner using the provided options and returns a job handle.