Skip to content

Commit

Permalink
import ProgressState type to d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Jan 7, 2025
1 parent a1e85a4 commit 5badbd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/addon-progress/src/ProgressAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';
import type { ProgressAddon as IProgressApi, IProgress, ProgressHandler } from '@xterm/addon-progress';


const enum ProgressState {
export const enum ProgressState {
REMOVE = 0,
SET = 1,
ERROR = 2,
Expand Down
5 changes: 3 additions & 2 deletions addons/addon-progress/typings/addon-progress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';
import type { ProgressState } from '../src/ProgressAddon';

declare module '@xterm/addon-progress' {
/** xterm.js addon providing an interface for ConEmu's progress sequence */
Expand All @@ -21,10 +22,10 @@ declare module '@xterm/addon-progress' {

/** progress object interface */
export interface IProgress {
state: 0 | 1 | 2 | 3 | 4;
state: ProgressState;
value: number;
}

/** Progress handler type */
export type ProgressHandler = (state: 0 | 1 | 2 | 3 | 4, value: number) => void;
export type ProgressHandler = (state: ProgressState, value: number) => void;
}

0 comments on commit 5badbd3

Please sign in to comment.