import { Config } from "./index";
const singleton = Symbol();
const singletonEnforcer = Symbol();
export class ConfigService extends Config {
    constructor(enforcer) {
        super();
        if (enforcer !== singletonEnforcer) {
            throw new Error('Cannot construct singleton');
        }
        this._type = 'ConfigService';
    }
    static get instance() {
        if (!this[singleton]) {
            this[singleton] = new ConfigService(singletonEnforcer);
        }
        return this[singleton];
    }
    singletonMethod() {
        return 'singletonMethod';
    }
    static staticMethod() {
        return 'staticMethod';
    }
    get type() {
        return this._type;
    }
    set type(value) {
        this._type = value;
    }
}
// export default ConfigService;
// ...
// index.js
//import ConfigService from './ConfigService';
// Instantiate
// console.log(new ConfigService); // Cannot construct singleton
// Instance
//const instance3 = ConfigService.instance;
// Prototype Method
//console.log(instance3.type, instance3.singletonMethod());
// Getter/Setter
//instance3.type = 'type updated';
//console.log(instance3.type);
// Static method
//console.log(ConfigService.staticMethod());
//# sourceMappingURL=config-service.js.map