3
3
* @license MIT
4
4
*/
5
5
6
- import { Terminal , ITerminalAddon , IDisposable } from '@xterm/xterm' ;
7
- import type { Event } from 'vs/base/common/event' ;
8
-
6
+ import { Terminal , ITerminalAddon , IDisposable , IEvent } from '@xterm/xterm' ;
9
7
10
8
declare module '@xterm/addon-progress' {
11
9
/**
12
10
* An xterm.js addon that provides an interface for ConEmu's progress
13
11
* sequence.
14
12
*/
15
13
export class ProgressAddon implements ITerminalAddon , IDisposable {
16
-
14
+
17
15
/**
18
16
* Creates a new progress addon
19
17
*/
@@ -24,7 +22,7 @@ declare module '@xterm/addon-progress' {
24
22
* @param terminal The terminal the addon is being loaded in.
25
23
*/
26
24
public activate ( terminal : Terminal ) : void ;
27
-
25
+
28
26
/**
29
27
* Disposes the addon.
30
28
*/
@@ -33,22 +31,38 @@ declare module '@xterm/addon-progress' {
33
31
/**
34
32
* An event that fires when the tracked progress changes.
35
33
*/
36
- public readonly onChange : Event < IProgressState > | undefined ;
34
+ public readonly onChange : IEvent < IProgressState > | undefined ;
37
35
38
36
/**
39
- * Gets or sets the current progress tracked by the addon.
40
- * This can also be used to reset a stuck progress indicator
41
- * back to initial with `{state: 0, value: 0}`
42
- * or to restore an indicator.
37
+ * Gets or sets the current progress tracked by the addon. This can be used
38
+ * to reset a stuck progress indicator back to initial with
39
+ * `{ state: 0, value: 0 }` or to restore an indicator.
43
40
*/
44
41
public progress : IProgressState ;
45
42
}
46
-
43
+
47
44
/**
48
45
* Progress state tracked by the addon.
49
46
*/
50
47
export interface IProgressState {
48
+ /**
49
+ * The progress state.
50
+ *
51
+ * - `0`: No progress. Setting this will resets progress value to 0
52
+ * regardless of the {@link value} used.
53
+ * - `1`: Normal percentage-based from 0 to 100.
54
+ * - `2`: Error with an optional progress value from 0 to 100.
55
+ * - `3`: Indeterminate progress, any progress value will be ignored. This
56
+ * is used to indicate work is happening but a percentage value cannot be
57
+ * determined.
58
+ * - `4`: Pause or warning state with an optional progress value.
59
+ */
51
60
state : 0 | 1 | 2 | 3 | 4 ;
61
+
62
+ /**
63
+ * The percentage value of progress from 0 to 100. See {@link state} for
64
+ * whether this is relevant.
65
+ */
52
66
value : number ;
53
67
}
54
68
}
0 commit comments