UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

1 lines 1.5 kB
import {a}from'./chunk-3YNK2VJA.js';import {NoViewfinder}from'@scandit/web-datacapture-core';var i=class t{constructor(){this.type="barcodeCapture";this._brush=a.BarcodeCaptureOverlay.DefaultBrush.clone();this._shouldShowScanAreaGuides=false;this._shouldRemoveLocationsAfterScan=true;this._viewfinder=null;}static async withBarcodeCapture(e){return t.withBarcodeCaptureForView(e,null)}static async withBarcodeCaptureForView(e,a){let r=new t;return r.barcodeCapture=e,await r.setBrush(r._brush),await(a==null?void 0:a.addOverlay(r)),r}getBrush(){return this._brush}getViewfinder(){return this._viewfinder}async setBrush(e){this._brush=e,await this.barcodeCapture.notifyContext();}async setShouldShowScanAreaGuides(e){this._shouldShowScanAreaGuides=e,await this.barcodeCapture.notifyContext();}async setShouldRemoveLocationsAfterScan(e){this._shouldRemoveLocationsAfterScan=e,await this.barcodeCapture.notifyContext();}async setViewfinder(e){this._viewfinder=e,await this.barcodeCapture.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}shouldRemoveLocationsAfterScan(){return this._shouldRemoveLocationsAfterScan}toJSONObject(){var e,a;return {type:this.type,brush:this._brush.toJSONObject(),drawLocalizedOnlyBarcodes:false,shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,shouldRemoveLocationsAfterScan:this._shouldRemoveLocationsAfterScan,viewfinder:(a=(e=this._viewfinder)==null?void 0:e.toJSONObject())!=null?a:NoViewfinder.toJSONObject()}}};export{i as a};