import '../../assert/js/assert.js';
import '../../globals.js';
import phetCore from './phetCore.js';
class EnumerationValue {
    toString() {
        return this.name;
    }
    // This method is unused, but needs to remain here so other types don't accidentally structurally match
    // enumeration values.  Without this, string satisfies the EnumerationValue interface, but we don't want it to.
    isEnumerationValue() { return true; }
    constructor() {
        const c = this.constructor;
        assert && assert(!EnumerationValue.sealedCache.has(c), 'cannot create instanceof of a sealed constructor');
        this._name = null;
        this._enumeration = null;
    }
    set name(name) {
        assert && assert(!this._name, 'name cannot be changed once defined.');
        this._name = name;
    }
    get name() {
        assert && assert(this._name, 'name cannot be retrieved until it has been filled in by Enumeration.');
        return this._name;
    }
    set enumeration(enumeration) {
        assert && assert(!this._enumeration, 'enumeration cannot be changed once defined.');
        this._enumeration = enumeration;
    }
    get enumeration() {
        assert && assert(this._enumeration, 'enumeration cannot be retrieved until it has been filled in by Enumeration.');
        return this._enumeration;
    }
}
// After an Enumeration is constructed, no new instances of that exact type can be made (though it is OK to
// create subtypes)
EnumerationValue.sealedCache = new Set();
phetCore.register('EnumerationValue', EnumerationValue);
export default EnumerationValue;
//# sourceMappingURL=EnumerationValue.js.map