mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:08:18 +08:00
* WIP * Fix type 1 * Missing types info * Some fixes * Several types refactoring and fixes * WIP * Fix grammar
19 lines
531 B
JavaScript
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)
|
|
}
|
|
}
|