import { type WebComponentInterface } from './WebComponentInterface'; import WebComponentType from './WebComponentType'; const createElementFactory = (component: WebComponentType): ((id?: string) => T & WebComponentInterface) => { return (id?: string): T & WebComponentInterface => { const element = document.createElement(component.tagName) as T & WebComponentInterface; if (id) { element.setId(id); } return element; }; }; export { createElementFactory }; export default createElementFactory;