"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Schema
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityReferenceSet = exports.ConcreteEntityTypes = void 0;
/**
 * Types of concrete entities. Used for storing strings in JavaScript reference-equality containers which encode
 * low-level entity information.
 * @note the values of this enum are unstable, do not depend upon their values between versions of iTwin.js
 *       (e.g. do not serialize them and load them in another version of iTwin.js and expect them to work)
 * CodeSpecs are excepted since their JavaScript representation does not derive from [Entity]($backend)
 * @note the string value of each variant is required/guaranteed to be 1 character
 * @see EntityReference
 * @alpha
 */
var ConcreteEntityTypes;
(function (ConcreteEntityTypes) {
    ConcreteEntityTypes["Model"] = "m";
    ConcreteEntityTypes["Element"] = "e";
    ConcreteEntityTypes["ElementAspect"] = "a";
    ConcreteEntityTypes["Relationship"] = "r";
})(ConcreteEntityTypes || (exports.ConcreteEntityTypes = ConcreteEntityTypes = {}));
/**
 * Adds some utilities to the [[ConcreteEntityTypes]] enum
 * @alpha
 */
(function (ConcreteEntityTypes) {
    const toBisCoreRootClassFullNameMap = {
        [ConcreteEntityTypes.Model]: "BisCore:Model",
        [ConcreteEntityTypes.Element]: "BisCore:Element",
        [ConcreteEntityTypes.ElementAspect]: "BisCore:ElementAspect",
        [ConcreteEntityTypes.Relationship]: "BisCore:Relationship",
    };
    /** used by the transformer to figure out where to check for the existence in a db of a concrete element id
     * @internal
     */
    function toBisCoreRootClassFullName(type) {
        return toBisCoreRootClassFullNameMap[type];
    }
    ConcreteEntityTypes.toBisCoreRootClassFullName = toBisCoreRootClassFullName;
})(ConcreteEntityTypes || (exports.ConcreteEntityTypes = ConcreteEntityTypes = {}));
/** A set of concrete entity ids, with additional functions to more literately add ids where you have the raw id and know what type it is
 * @alpha
 */
class EntityReferenceSet extends Set {
    addElement(id) { this.add(`e${id}`); }
    addModel(id) { this.add(`m${id}`); }
    addAspect(id) { this.add(`a${id}`); }
    addRelationship(id) { this.add(`r${id}`); }
}
exports.EntityReferenceSet = EntityReferenceSet;
//# sourceMappingURL=EntityReference.js.map