/**
 * Manages the registration and retrieval of HTML templates.
 * Implements the singleton pattern to ensure a single global instance.
 *
 * @public
 */
export class DataTemplateRegistry {
    // #region Fields
    static _instance = null;
    _registry;
    // #endregion
    // #region Ctor
    /**
     * Constructs a new instance of the `DataTemplateRegistry` class.
     *
     * @public
     */
    constructor() {
        this._registry = new Map();
    }
    // #endregion
    // #region Properties
    /**
     * Accesses the singleton instance of the TemplateRegistry.
     *
     * @public
     * @returns {DataTemplateRegistry} The singleton instance.
     */
    static get instance() {
        if (!DataTemplateRegistry._instance) {
            DataTemplateRegistry._instance = new DataTemplateRegistry();
        }
        return DataTemplateRegistry._instance;
    }
    // #endregion
    // #region Methods
    /**
     * Registers a template with a unique ID.
     *
     * @public
     * @param {string} templateId - The unique identifier for the template.
     * @param {HTMLTemplateElement} template - The template element to register.
     */
    registerTemplate(templateId, template) {
        this._registry.set(templateId, template);
    }
    /**
     * Retrieves a template by its ID.
     *
     * @public
     * @param {string} templateId - The unique identifier for the template.
     * @returns {HTMLTemplateElement | undefined} The template element, if found.
     */
    getTemplate(templateId) {
        return this._registry.get(templateId);
    }
    /**
     * Removes a template from the registry by its ID.
     *
     * @public
     * @param {string} templateId - The unique identifier for the template to remove.
     */
    removeTemplate(templateId) {
        this._registry.delete(templateId);
    }
}
//# sourceMappingURL=DataTemplateRegistry.js.map