From 4e183b18818864b23501fa4bccd2813ca4149e5a Mon Sep 17 00:00:00 2001 From: Lihang Xu Date: Thu, 30 Jun 2022 16:56:29 +0800 Subject: [PATCH] feat(dynamsoft-barcode): update startScanning options (#4205) * add barcodeBytesBase64 to the BarcodeResult * update startScanning's param to ScanOptions --- .../dynamsoft-barcode-scanner/index.ts | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/dynamsoft-barcode-scanner/index.ts b/src/@awesome-cordova-plugins/plugins/dynamsoft-barcode-scanner/index.ts index 67eb61a7..d9efd386 100755 --- a/src/@awesome-cordova-plugins/plugins/dynamsoft-barcode-scanner/index.ts +++ b/src/@awesome-cordova-plugins/plugins/dynamsoft-barcode-scanner/index.ts @@ -9,6 +9,15 @@ import { } from '@awesome-cordova-plugins/core'; import { Observable } from 'rxjs'; +/** + * dceLicense: License of Dynamsoft Camera Enhancer + * resolution: use EnumResolution + */ +export interface ScanOptions { + dceLicense?: string; + resolution?: number; +} + export interface FrameResult { frameWidth: number; frameHeight: number; @@ -18,6 +27,7 @@ export interface FrameResult { export interface BarcodeResult { barcodeText: string; barcodeFormat: string; + barcodeBytesBase64?: string; x1: number; x2: number; x3: number; @@ -28,6 +38,15 @@ export interface BarcodeResult { y4: number; } +export enum EnumResolution { + RESOLUTION_AUTO = 0, + RESOLUTION_480P = 1, + RESOLUTION_720P = 2, + RESOLUTION_1080P = 3, + RESOLUTION_2K = 4, + RESOLUTION_4K = 5 +} + /** * @name dynamsoft-barcode-scanner * @description @@ -107,7 +126,7 @@ export class BarcodeScanner extends AwesomeCordovaNativePlugin { /** * start the camera to scan barcodes - * @param dceLicense {string} License of Dynamsoft Camera Enhancer + * @param options {ScanOptions} * @return {Observable} */ @Cordova({ @@ -115,7 +134,7 @@ export class BarcodeScanner extends AwesomeCordovaNativePlugin { errorIndex: 2, observable: true, }) - startScanning(dceLicense?: string): Observable { + startScanning(options?: ScanOptions): Observable { return; }