Create knot on link double click

This commit is contained in:
barsdeveloper
2022-11-15 14:31:26 +01:00
parent decef44d02
commit f2c09faedb
26 changed files with 2136 additions and 1800 deletions

View File

@@ -0,0 +1,25 @@
/**
* @typedef {new (...args) => IElement} ElementConstructor
* @typedef {import("./IElement").default} IElement
*/
export default class ElementFactory {
/** @type {Map<String, ElementConstructor>} */
static #elementConstructors = new Map()
/**
* @param {String} tagName
* @param {ElementConstructor} entityConstructor
*/
static registerElement(tagName, entityConstructor) {
ElementFactory.#elementConstructors.set(tagName, entityConstructor)
}
/**
* @param {String} tagName
*/
static getConstructor(tagName) {
return ElementFactory.#elementConstructors.get(tagName)
}
}