scandit-web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
8 lines (5 loc) • 1.81 kB
JavaScript
import { a } from './chunk-7YXHQEOP.js';
import { b } from './chunk-TRWFJYCT.js';
import { Brush } from 'scandit-web-datacapture-core';
var s=class o{constructor(){this.type="sparkScan";this._shouldShowScanAreaGuides=!1;this._shouldRemoveLocationsAfterScan=!0;this._shouldDrawViewfinder=!1;this._style=b.SparkScan.SparkScanOverlay.defaultStyle;this._viewfinder=new a;}get style(){return this._style}static async withSparkScanForView(r,a){let t=new o;return t.sparkScan=r,await t.setBrush(new Brush(b.SparkScan.SparkScanOverlay.DefaultBrush.fillColor,b.SparkScan.SparkScanOverlay.DefaultBrush.strokeColor,b.SparkScan.SparkScanOverlay.DefaultBrush.strokeWidth)),a&&await a.addOverlay(t),t}setRadius(r){this._viewfinder.radius=r;}getBrush(){return this._brush}async setBrush(r){this._brush=r,await this.sparkScan.notifyContext();}async setErrorBrush(r){this._errorBrush=r,await this.sparkScan.notifyContext();}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 };