import MathUtils from "./MathUtils"; export default class TornStyleSwitch { private readonly baseElement; private readonly randomId; private readonly input; constructor(label: string, checked: boolean = false) { this.randomId = MathUtils.getInstance().getRandomInt(100, 2000); this.baseElement = document.createElement('span'); this.baseElement.id = 'WHSwitch' + this.randomId; this.baseElement.innerHTML = ` `; this.input = this.baseElement.querySelector('input') as HTMLInputElement; } public getBase(): HTMLElement { return this.baseElement }; public getInput(): HTMLInputElement { return this.input; } public getHtml(): string { return this.baseElement.innerHTML; } }