import Soul from "../video/Soul"; import App from "../video/App"; export default class Widget { app: App; soul: Soul; version: string; isOnline: boolean; static instance: any; constructor(name, version) { Widget.instance = this; this.version = version; console.log(`${name} v.${version}`); window[name] = this; } getCanvas(divID): any { let divCanvas = document.getElementById(divID); if (divCanvas) { if (this.soul) { this.isOnline = false; this.soul.destroy(); } let canvas = document.createElement('canvas'); divCanvas.appendChild(canvas); return canvas; } else { console.log('No DIV!', divID); return null; } } get IsConnected() { return this.isOnline; } disconnect() { } connect() { } create(soul) { this.soul = soul; this.app = soul.MainApp; } destroy() { this.app.destroy(); } }