@scandit/web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
1 lines • 1.68 kB
JavaScript
import {a as a$1}from'./chunk-K37AJSFT.js';import {a}from'./chunk-CHU6GKFW.js';var B=(a=>(a.Frame="frame",a.Dot="dot",a))(B||{}),o=class c{constructor(){this.type="barcodeTrackingBasic";this._style=a.BarcodeBatchBasicOverlay.defaultStyle;this._shouldShowScanAreaGuides=false;this._brushesForBarcodes=new Map;}get style(){return this._style}get listener(){return this._listener}set listener(e){this._listener=e;}get brush(){return this._brush}static async withBarcodeBatch(e){return c.withBarcodeBatchForView(e,null)}static async withBarcodeBatchForView(e,a$1){return c.withBarcodeBatchForViewWithStyle(e,a$1,a.BarcodeBatchBasicOverlay.defaultStyle)}static async withBarcodeBatchForViewWithStyle(e,a$2,i){let r=new c;return r.barcodeBatch=e,r._style=i,r._brush=a.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.clone(),a$2&&await a$2.addOverlay(r),r.privateListener=new a$1(r),e.addPrivateListener(r.privateListener),r}async setBrush(e){this._brush=e,await this.barcodeBatch.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}async setShouldShowScanAreaGuides(e){this._shouldShowScanAreaGuides=e,await this.barcodeBatch.notifyContext();}async setBrushForTrackedBarcode(e,a){this._brushesForBarcodes.set(a.identifier,e),await this.barcodeBatch.notifyContext();}async clearTrackedBarcodeBrushes(){this._brushesForBarcodes.clear(),await this.barcodeBatch.notifyContext();}toJSONObject(){return {type:this.type,brush:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,style:this._style,brushesForBarcodes:[...this._brushesForBarcodes.entries()].reduce((e,[a,i])=>(e[a]=i.toJSONObject(),e),{})}}};export{B as a,o as b};