33 * @license MIT
44 */
55
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' ;
97
108declare module '@xterm/addon-progress' {
119 /**
1210 * An xterm.js addon that provides an interface for ConEmu's progress
1311 * sequence.
1412 */
1513 export class ProgressAddon implements ITerminalAddon , IDisposable {
16-
14+
1715 /**
1816 * Creates a new progress addon
1917 */
@@ -24,7 +22,7 @@ declare module '@xterm/addon-progress' {
2422 * @param terminal The terminal the addon is being loaded in.
2523 */
2624 public activate ( terminal : Terminal ) : void ;
27-
25+
2826 /**
2927 * Disposes the addon.
3028 */
@@ -33,22 +31,38 @@ declare module '@xterm/addon-progress' {
3331 /**
3432 * An event that fires when the tracked progress changes.
3533 */
36- public readonly onChange : Event < IProgressState > | undefined ;
34+ public readonly onChange : IEvent < IProgressState > | undefined ;
3735
3836 /**
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.
4340 */
4441 public progress : IProgressState ;
4542 }
46-
43+
4744 /**
4845 * Progress state tracked by the addon.
4946 */
5047 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+ */
5160 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+ */
5266 value : number ;
5367 }
5468}
0 commit comments