@scandit/web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
8 lines (5 loc) • 1.56 kB
JavaScript
import { a, b as b$1 } from './chunk-E5OIMFVX.js';
import { b } from './chunk-XCZGCZ5K.js';
import { Vibration, Feedback, Brush, Color } from '@scandit/web-datacapture-core';
var r=class{constructor(e,c){this.visualFeedbackColor=e,this.feedback=c;}static defaultSuccessFeedback(){let e=Vibration.withPattern([300]);return new Feedback(e,a)}static defaultErrorFeedback(){let e=Vibration.withPattern(b.SparkScan.SparkScanFeedback.errorVibrationPattern);return new Feedback(e,b$1)}static defaultSuccessBrush(){return new Brush(Color.fromRGBA(0,0,0,0),Color.fromRGBA(250,250,250,1),3)}static defaultErrorBrush(){return new Brush(Color.fromRGBA(0,0,0,0),Color.fromRGBA(250,68,70,1),1)}static success(){return new u}},k=class extends r{constructor(e,c,a,s,o){super(a!=null?a:Color.fromRGBA(250,68,70,1),o!=null?o:r.defaultErrorFeedback()),this.message=e,this.resumeCapturingDelay=c,this.brush=s!=null?s:r.defaultErrorBrush();}toJSONObject(){return {type:"error",barcodeFeedback:{feedback:this.feedback.toJSONObject(),message:this.message,resumeCapturingDelay:this.resumeCapturingDelay,visualFeedbackColor:this.visualFeedbackColor.toJSON(),brush:this.brush.toJSONObject()}}}},u=class extends r{constructor(e,c,a){super(e!=null?e:Color.fromRGBA(46,193,206,1),a!=null?a:r.defaultSuccessFeedback()),this.brush=c!=null?c:r.defaultSuccessBrush();}toJSONObject(){return {type:"success",barcodeFeedback:{visualFeedbackColor:this.visualFeedbackColor.toJSON(),feedback:this.feedback.toJSONObject(),brush:this.brush.toJSONObject()}}}};
export { r as a, k as b, u as c };