type AlertType = 'info' | 'warning' | 'error'; interface IAlertArgs { id: string; type: AlertType; roomId: string; } export class Alert implements IAlertArgs { roomId: string id: string type: AlertType timestamp: Date | null = null active = false isInfo = false isWarning = false isError = false constructor(data: IAlertArgs) { this.id = data.id this.type = data.type this.roomId = data.roomId if (data.type == 'info') this.isInfo = true else if (data.type == 'warning') this.isWarning = true else if (data.type == 'error') this.isError = true } }