2018-12-13 23:01:12 +00:00
|
|
|
// Type definitions for multi-progress 2.0
|
2018-11-30 20:13:16 +00:00
|
|
|
// Project: https://github.com/pitaj/multi-progress
|
|
|
|
|
// Definitions by: David Brett <https://github.com/DHBrett>
|
|
|
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
|
|
|
|
|
|
/// <reference types="node"/>
|
|
|
|
|
|
2018-12-15 21:53:29 +00:00
|
|
|
import ProgressBar = require('progress');
|
2018-11-30 20:13:16 +00:00
|
|
|
import { Stream } from 'stream';
|
|
|
|
|
|
2018-12-13 22:47:24 +00:00
|
|
|
export as namespace MultiProgress;
|
|
|
|
|
|
|
|
|
|
export = MultiProgress;
|
|
|
|
|
|
|
|
|
|
declare class MultiProgress {
|
2018-11-30 20:13:16 +00:00
|
|
|
/**
|
|
|
|
|
* Create a new @see MultiProgress with the given stream, or stderr by default
|
|
|
|
|
* @param stream A stream to write the progress bars to
|
|
|
|
|
*/
|
|
|
|
|
constructor(stream?: Stream)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add a new bar
|
|
|
|
|
*/
|
2018-12-13 22:34:55 +00:00
|
|
|
newBar: (format: string, options: ProgressBar.ProgressBarOptions) => ProgressBar;
|
2018-11-30 20:13:16 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Close all bars
|
|
|
|
|
*/
|
|
|
|
|
terminate: () => void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Render the given progress bar
|
|
|
|
|
*/
|
|
|
|
|
move: (index: number) => void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Move the bar indicated by index forward the number of steps indicated by value
|
|
|
|
|
*/
|
|
|
|
|
tick: (index: number, value: number, options?: any) => void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update the bar indicated by index to the value given
|
|
|
|
|
*/
|
|
|
|
|
update: (index: number, value: number, options?: any) => void;
|
|
|
|
|
}
|
2018-12-13 22:47:24 +00:00
|
|
|
|
|
|
|
|
declare namespace MultiProgress {}
|