This repository has been archived by the owner on Jul 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typings.d.ts
67 lines (59 loc) · 1.74 KB
/
typings.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
// Type definitions for listr 0.13
// Project: https://github.com/samverschueren/listr#readme
// Definitions by: Dusan Radovanovic <https://github.com/durad>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as stream from "stream";
import { Observable } from "rxjs";
declare namespace Listr {
interface ListrRenderer {
nonTTY: boolean;
render(): void;
end(): void;
}
interface ListrOptions {
concurrent?: boolean | number;
exitOnError?: boolean;
renderer?: "silent" | "default" | "verbose" | ListrRenderer;
nonTTYRenderer?: "silent" | "default" | "verbose" | ListrRenderer;
}
interface ListrTask {
title: string;
output?: string;
task: (
ctx: any,
task: ListrTaskWrapper,
) =>
| void
| string
| Promise<any>
| stream.Readable
| Listr
| Observable<any>;
skip?: (
ctx: any,
task: ListrTaskWrapper,
) => boolean | Promise<boolean> | string | void;
enabled?: (
ctx: any,
task: ListrTaskWrapper,
) => boolean | Promise<boolean>;
}
interface ListrTaskWrapper {
title: string;
output: any;
report(error: Error): void;
skip(message: string): void;
run(ctx?: any): Promise<any>;
}
}
declare class Listr {
constructor(
tasks?: ReadonlyArray<Listr.ListrTask>,
options?: Listr.ListrOptions,
);
constructor(options?: Listr.ListrOptions);
add(tasks: Listr.ListrTask | ReadonlyArray<Listr.ListrTask>): void;
run(ctx?: any): Promise<any>;
}
export = Listr;