UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

1 lines 1.77 kB
import {a,b}from'./chunk-E5OIMFVX.js';import {a as a$1}from'./chunk-HDODW33D.js';import {Vibration,Feedback}from'@scandit/web-datacapture-core';var o=Vibration.withPattern([40]),c=class b$1{constructor(i,n){this.soundEnabled=true;this.hapticEnabled=true;this.tapVibration=this.hapticEnabled?o:null;this.tapFeedback=new Feedback(this.tapVibration,null);this.successSound=this.soundEnabled?a:null;this.successVibration=this.hapticEnabled?o:null;this.successFeedback=new Feedback(this.successVibration,this.successSound);this.errorSound=this.soundEnabled?b:null;this.noFeedback=new Feedback(null,null);this.errorVibration=this.hapticEnabled?Vibration.withPattern(a$1.SparkScanFeedback.errorVibrationPattern):null;this.errorFeedback=new Feedback(this.errorVibration,this.errorSound);this.soundEnabled=i,this.hapticEnabled=n;}static withDefaults(i,n){return new b$1(i,n)}setSoundEnabled(i){this.soundEnabled=i,this.successSound=i?a:null,this.successFeedback=new Feedback(this.successVibration,this.successSound),this.errorSound=i?b:null,this.errorFeedback=new Feedback(this.errorVibration,this.errorSound);}setHapticEnabled(i){this.hapticEnabled=i,this.tapVibration=i?o:null,this.tapFeedback=new Feedback(this.tapVibration,null),this.successVibration=i?Vibration.defaultVibration:null,this.successFeedback=new Feedback(this.successVibration,this.successSound),this.errorVibration=i?Vibration.withPattern(a$1.SparkScanFeedback.errorVibrationPattern):null,this.errorFeedback=new Feedback(this.errorVibration,this.errorSound);}emitTapFeedback(){this.tapFeedback.emit();}emitBarcodeFeedback(i){var l,u;new Feedback(this.hapticEnabled&&(l=i==null?void 0:i.feedback.vibration)!=null?l:null,this.soundEnabled&&(u=i==null?void 0:i.feedback.sound)!=null?u:null).emit();}};export{c as a};