@scandit/web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
1 lines • 1.1 kB
JavaScript
import{ArucoDictionary as e}from"./ArucoDictionary.js";import"./ArucoDictionaryPreset.js";import"./Barcode.js";import{defaultSymbologies as t}from"./defaults/DefaultsSymbologies.js";var n=class{constructor(){this.properties={},this.symbologies={},this._arucoDictionary=null}get enabledSymbologies(){return Object.keys(this.symbologies).filter(e=>this.symbologies[e].isEnabled)}settingsForSymbology(e){if(!this.symbologies[e]){let n=t.SymbologySettings[e];n._symbology=e,this.symbologies[e]=n}return this.symbologies[e]}setProperty(e,t){this.properties[e]=t}getProperty(e){return this.properties[e]}enableSymbologies(e){for(let t of e)this.enableSymbology(t,!0)}enableSymbology(t,n){this.settingsForSymbology(t).isEnabled=n,t===`aruco`&&(this._arucoDictionary=e.fromPreset(`5X5_50`))}setArucoDictionary(e){this._arucoDictionary=e}toJSONObject(){var e;return{properties:this.properties,symbologies:Object.keys(this.symbologies).reduce((e,t)=>(e[t]=this.symbologies[t].toJSONObject(),e),{}),arucoDictionary:((e=this._arucoDictionary)==null?void 0:e.toJSONObject())??null}}};export{n as BarcodeBatchSettings};