-
-
Notifications
You must be signed in to change notification settings - Fork 439
/
Copy pathresponse-service.ts
38 lines (34 loc) · 1001 Bytes
/
response-service.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Event } from '@theia/core/lib/common/event';
export interface OutputMessage {
readonly chunk: string;
readonly severity?: OutputMessage.Severity;
}
export namespace OutputMessage {
export enum Severity {
Error,
Warning,
Info,
}
}
export interface ProgressMessage {
readonly progressId: string;
readonly message: string;
readonly work?: ProgressMessage.Work;
}
export namespace ProgressMessage {
export interface Work {
readonly done: number;
readonly total: number;
}
}
export const ResponseServicePath = '/services/response-service';
export const ResponseService = Symbol('ResponseService');
export interface ResponseService {
appendToOutput(message: OutputMessage): void;
reportProgress(message: ProgressMessage): void;
}
export const ResponseServiceArduino = Symbol('ResponseServiceArduino');
export interface ResponseServiceArduino extends ResponseService {
onProgressDidChange: Event<ProgressMessage>;
clearArduinoChannel: () => void;
}