Files
ueblueprint/js/element/ElementFactory.js
barsdeveloper fdd86ce5de Refactor jsdoc types (#16)
* WIP

* Fix type 1

* Missing types info

* Some fixes

* Several types refactoring and fixes

* WIP

* Fix grammar
2023-09-22 22:56:33 +02:00

19 lines
531 B
JavaScript

export default class ElementFactory {
/** @type {Map<String, AnyConstructor<IElement>>} */
static #elementConstructors = new Map()
/**
* @param {String} tagName
* @param {AnyConstructor<IElement>} entityConstructor
*/
static registerElement(tagName, entityConstructor) {
ElementFactory.#elementConstructors.set(tagName, entityConstructor)
}
/** @param {String} tagName */
static getConstructor(tagName) {
return ElementFactory.#elementConstructors.get(tagName)
}
}