diff --git a/src/app/services/processmanager.service.ts b/src/app/services/processmanager.service.ts index 80b8544..f8d289c 100644 --- a/src/app/services/processmanager.service.ts +++ b/src/app/services/processmanager.service.ts @@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; import { WebSocketService } from './websocket.service'; import { ProcessCommand } from './processcommand'; import { filter } from 'rxjs/operators'; +import { WSMessage } from './wsmessage'; @Injectable() @@ -16,11 +17,11 @@ export class ProcessManagerService { this.webSocketService.connect(); } - subscribeCallback(process_name: string, callback: (event: any) => void) { + subscribeCallback(process_name: string, callback: (event: WSMessage) => void) { this.observeProcessMessage(process_name).subscribe(callback); } - subscribeErrorCallback(process_name: string, callback: (event: any) => void) { + subscribeErrorCallback(process_name: string, callback: (event: WSMessage) => void) { this.observeProcessMessage(process_name).pipe(filter(message => 'error' in message.data)).subscribe(callback); }