UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

4 lines (2 loc) 1.12 kB
var i=class{constructor(e,t,r){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=t,this.workerFunctions=r,this.setup();}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())});}getBatchDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeBatchListener.extend("BarcodeTrackingListener",{didUpdateSession:(r,a)=>{this.barcodeBatchDidUpdateSession(a);},onTrackedBarcodeTapped:(r,a)=>{this.onTrackedBarcodeTapped(a);}}),t=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(r,a)=>{this.trackingListenerSet||(a.addListener(new e,1),this.trackingListenerSet=!0);},onModeDeserializationStarted(){},onSettingsDeserializationStarted(){},onSettingsDeserializationFinished(){}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new t);}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())});}}; export { i as a };