const led = ` `; export interface ILEDOptions { color: string; lightColor?: string; } const ON_CLASS = 'led-on'; export class LED { readonly el = document.createElement('span'); private readonly lightEl: SVGElement; constructor({ color, lightColor }: ILEDOptions) { this.el.innerHTML = led .replace('{{color}}', color) .replace('{{lightColor}}', lightColor || color); this.lightEl = this.el.querySelector('.light'); this.lightEl.style.display = 'none'; } get value() { return this.lightEl.style.display !== 'none'; } set value(value: boolean) { this.lightEl.style.display = value ? '' : 'none'; } }