UNPKG

polyv-live-cli

Version:

CLI tool for managing PolyV live streaming services.

35 lines 965 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Component = void 0; class Component { constructor(config, eventBus) { this.config = config; this.eventBus = eventBus; this.state = { id: this.generateId(), type: config.type, status: 'initializing', lastUpdate: new Date(), }; } emit(event, data) { this.eventBus.emit(event, { ...data, source: this.state.id }); } subscribe(event, handler) { this.eventBus.on(event, handler); } unsubscribe(event, handler) { this.eventBus.off(event, handler); } getState() { return { ...this.state }; } getWidget() { return this.widget; } generateId() { return `${this.config.type}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; } } exports.Component = Component; //# sourceMappingURL=monitoring.js.map