UNPKG

@visulima/ansi

Version:

ANSI escape codes for some terminal swag.

43 lines (42 loc) 1.96 kB
/** * Resets the progress bar to its default state (hidden). * * Sequence: `OSC 9 ; 4 ; 0 BEL` * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences} */ declare const resetProgressBar: string; /** * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "default" state. * * Sequence: `OSC 9 ; 4 ; 1 ; Percentage BEL` * @param percentage The progress percentage (0-100, clamped automatically) * @returns The progress bar sequence * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences} */ declare const setProgressBar: (percentage: number) => string; /** * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Error" state. * * Sequence: `OSC 9 ; 4 ; 2 ; Percentage BEL` * @param percentage The progress percentage (0-100, clamped automatically) * @returns The error progress bar sequence * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences} */ declare const setErrorProgressBar: (percentage: number) => string; /** * Sets the progress bar to the indeterminate state. * * Sequence: `OSC 9 ; 4 ; 3 BEL` * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences} */ declare const setIndeterminateProgressBar: string; /** * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Warning" state. * * Sequence: `OSC 9 ; 4 ; 4 ; Percentage BEL` * @param percentage The progress percentage (0-100, clamped automatically) * @returns The warning progress bar sequence * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences} */ declare const setWarningProgressBar: (percentage: number) => string; export { resetProgressBar, setErrorProgressBar, setIndeterminateProgressBar, setProgressBar, setWarningProgressBar };