UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

1 lines 1.8 kB
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,e){let a$1=new o;return a$1.sparkScan=r,await a$1.setBrush(a.SparkScanOverlay.DefaultBrush.clone()),e&&await e.addOverlay(a$1),a$1}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 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,e;return {type:this.type,brush:this._brush.toJSONObject(),errorBrush:(e=(r=this._errorBrush)==null?void 0:r.toJSONObject())!=null?e:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,shouldRemoveLocationsAfterScan:this._shouldRemoveLocationsAfterScan,viewfinder:this._viewfinder.toJSONObject(),style:this.style,shouldDrawViewfinder:this._shouldDrawViewfinder}}};export{s as a};