import { GS1encoder } from './gs1encoder.mjs';

/*window.GS1Module = {
    createEncoder: function() {
        const encoder = new GS1encoder();


        // Possibly add methods to interact with the encoder
        return encoder;
    }
};*/

window.GS1Module = (function() {


    GS1encoder.prototype.setDataStr = function(dataStr) {
        this.dataStr = dataStr;
    };

    GS1encoder.prototype.trySetDataStr = function(dataStr) {
        try {
            this.dataStr = dataStr;
            return true;
        }
        catch {
            return false;
        }
    };

    GS1encoder.prototype.setAiDataStr = function(aiDataStr) {
        this.aiDataStr = aiDataStr;
    };

    GS1encoder.prototype.trySetAiDataStr = function(aiDataStr) {
        try {
            this.aiDataStr = aiDataStr;
            return true;
        }
        catch {
            return false;
        }
    };

    GS1encoder.prototype.getHRI = function() {
        return this.hri;
    };

    function createEncoder() {
        return new GS1encoder();
    }

    return {
        createEncoder: createEncoder
    };
})();