-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add inc method for incrementing pbar value
- Loading branch information
1 parent
d73f626
commit 91c6883
Showing
8 changed files
with
203 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@opentf/cli-pbar': minor | ||
--- | ||
|
||
Added inc method to increment the progress bar value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,5 @@ build | |
built | ||
lib | ||
|
||
play.js | ||
play.js | ||
test.[tj]s |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
import type { WriteStream } from 'node:tty'; | ||
|
||
export type BarSize = 'SMALL' | 'MEDIUM' | 'DEFAULT'; | ||
|
||
export type Options = { | ||
stream?: NodeJS.WriteStream; | ||
width?: number; | ||
color?: string; | ||
bgColor?: string; | ||
autoClear?: boolean; | ||
size?: BarSize; | ||
/** The wriatable stream to use, default is stderr. */ | ||
stream: WriteStream; | ||
/** The width of the rendered progress bar. */ | ||
width: number; | ||
/** The foreground color of completed bars. */ | ||
color: string; | ||
/** The background color of bars. */ | ||
bgColor: string; | ||
/** Set true to remove the progress bar after it completed. */ | ||
autoClear: boolean; | ||
/** The size of the progress bar to render, default is 30. */ | ||
size: BarSize; | ||
/** The string to be prefixed progress bar */ | ||
prefix: string; | ||
/** The string to be suffixed progress bar */ | ||
suffix: string; | ||
/** Show hide progress bar percent */ | ||
showPercent: boolean; | ||
/** Show hide progress bar count */ | ||
showCount: boolean; | ||
}; | ||
|
||
// export interface IRunOptions { | ||
// total: number; | ||
// value: number; | ||
// prefix?: string; | ||
// suffix?: string; | ||
// color?: string; | ||
// } | ||
|
||
export type Bar = { | ||
export type Bar = Omit<Options, 'stream' | 'width' | 'autoClear'> & { | ||
id?: number; | ||
total: number; | ||
value: number; | ||
id?: number; | ||
prefix?: string; | ||
suffix?: string; | ||
color?: string; | ||
bgColor?: string; | ||
size?: BarSize; | ||
progress?: boolean; | ||
}; |