import { Translate } from "./translate";
const singleton = Symbol();
const singletonEnforcer = Symbol();
export class TranslateService extends Translate {
    constructor(enforcer) {
        super();
        if (enforcer !== singletonEnforcer) {
            throw new Error('Cannot construct singleton');
        }
        this._type = 'TranslateService';
    }
    static get instance() {
        if (!this[singleton]) {
            this[singleton] = new TranslateService(singletonEnforcer);
        }
        return this[singleton];
    }
    registerTranslateComponents() {
        let components = Array.from(document.getElementsByTagName('ema-translate'));
        components.forEach((el) => {
            el['setTranslateService'](this);
        });
    }
    get type() {
        return this._type;
    }
    set type(value) {
        this._type = value;
    }
}
//# sourceMappingURL=translate-service.js.map