@scandit/web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
1 lines • 1.9 kB
JavaScript
import {a as a$1}from'./chunk-MUK52FJN.js';import {a}from'./chunk-HDODW33D.js';var s=class o{constructor(){this.type="sparkScan";this._shouldShowScanAreaGuides=false;this._shouldRemoveLocationsAfterScan=true;this._shouldDrawViewfinder=false;this._style=a.SparkScanOverlay.defaultStyle;this._viewfinder=new a$1;}get style(){return this._style}static async withSparkScanForView(r,a$1){let e=new o;return e.sparkScan=r,await e.setBrush(a.SparkScanOverlay.DefaultBrush.clone()),a$1&&await a$1.addOverlay(e),e}setRadius(r){this._viewfinder.radius=r;}getBrush(){return this._brush}async setBrush(r){this._brush=r,await this.sparkScan.notifyContext();}async overlayReadyForDraw(){await this.sparkScan.workerCommand("sparkScanOverlayReadyForDraw",{});}async discardEnqueuedData(){await this.sparkScan.workerCommand("sparkScanOverlayDiscardEnqueuedData",{});}async setErrorBrush(r){this._errorBrush=r,await this.sparkScan.notifyContext();}getErrorBrush(){var r;return (r=this._errorBrush)!=null?r:this._brush}async setShouldShowScanAreaGuides(r){this._shouldShowScanAreaGuides=r,await this.sparkScan.notifyContext();}async setShouldRemoveLocationsAfterScan(r){this._shouldRemoveLocationsAfterScan=r,await this.sparkScan.notifyContext();}async setShouldDrawViewfinder(r){this._shouldDrawViewfinder=r,await this.sparkScan.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}shouldRemoveLocationsAfterScan(){return this._shouldRemoveLocationsAfterScan}toJSONObject(){var r,a;return {type:this.type,brush:this._brush.toJSONObject(),errorBrush:(a=(r=this._errorBrush)==null?void 0:r.toJSONObject())!=null?a:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,shouldRemoveLocationsAfterScan:this._shouldRemoveLocationsAfterScan,viewfinder:this._viewfinder.toJSONObject(),style:this.style,shouldDrawViewfinder:this._shouldDrawViewfinder}}};export{s as a};