forked from derrickpelletier/node-status
-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.d.ts
67 lines (50 loc) · 1.5 KB
/
status.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* @author Rodolfo Aguirre <aguirreg.rodolfo@gmail.com>
*/
// Manage the Status
export interface StatusOptions {
invert?:boolean;
interval?:number;
pattern?:string;
bottom?:boolean;
}
export function start( options:StatusOptions ):void;
export function stop():void;
export function setPattern( pattern:string, indentation?:number );
export function cellCount():number;
// Manage Items
export interface StatusItemOptions {
name?:string;
max?:number;
precision?:number;
steps?:string[];
custom?:() => string;
}
export interface StatusItem {
name:string;
max:number;
precision:number;
steps?:string[];
custom?:() => string;
count:number;
doneStep( status:boolean, message?:string | string[], indentation?:number ):void;
render( style:"step" | "custom" | "percentage" | "time" | "bar" | "default" | "count" ):string;
inc():void;
dec():void;
}
export function addItem( name:string, options:StatusItemOptions ):StatusItem;
export function removeItem( statusItem:StatusItem );
export function removeItem( name:string );
export function removeAll();
// Visuals
export function toString():string;
export function clear():void;
export function onTerminate(fn:Function);
export interface StatusConsole {
log( message?:any, ...optionalParams:any[] ):void;
info( message?:any, ...optionalParams:any[] ):void;
error( message?:any, ...optionalParams:any[] ):void;
warn( message?:any, ...optionalParams:any[] ):void;
}
export function console():StatusConsole;
export function stamp( pattern:string ):void;