Skip to content

Commit

Permalink
feat(dynamsoft-barcode): update startScanning options (#4205)
Browse files Browse the repository at this point in the history
* add barcodeBytesBase64 to the BarcodeResult

* update startScanning's param to ScanOptions
  • Loading branch information
xulihang committed Jun 30, 2022
1 parent 63c8365 commit 4e183b1
Showing 1 changed file with 21 additions and 2 deletions.
Expand Up @@ -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;
Expand All @@ -18,6 +27,7 @@ export interface FrameResult {
export interface BarcodeResult {
barcodeText: string;
barcodeFormat: string;
barcodeBytesBase64?: string;
x1: number;
x2: number;
x3: number;
Expand All @@ -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
Expand Down Expand Up @@ -107,15 +126,15 @@ export class BarcodeScanner extends AwesomeCordovaNativePlugin {

/**
* start the camera to scan barcodes
* @param dceLicense {string} License of Dynamsoft Camera Enhancer
* @param options {ScanOptions}
* @return {Observable<FrameResult>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
observable: true,
})
startScanning(dceLicense?: string): Observable<FrameResult> {
startScanning(options?: ScanOptions): Observable<FrameResult> {
return;
}

Expand Down

0 comments on commit 4e183b1

Please sign in to comment.