UNPKG

1.19 kBTypeScriptView Raw
1/// <reference types="node" />
2import { LogUpdate } from 'log-update';
3import { Colors } from './colors';
4import { TaskChain } from './tasks';
5export interface OutputStrategy {
6 readonly stream: NodeJS.WritableStream;
7 createTaskChain(): TaskChain;
8}
9export interface RedrawLine {
10 redrawLine(msg?: string): void;
11}
12export interface StreamOutputStrategyOptions {
13 readonly stream: NodeJS.WritableStream;
14 readonly colors?: Colors;
15}
16export declare class StreamOutputStrategy implements OutputStrategy {
17 readonly stream: NodeJS.WritableStream;
18 protected readonly colors: Colors;
19 constructor({ stream, colors }: StreamOutputStrategyOptions);
20 createTaskChain(): TaskChain;
21}
22export interface LogUpdateOutputStrategyOptions {
23 readonly stream?: NodeJS.WritableStream;
24 readonly colors?: Colors;
25}
26export declare class LogUpdateOutputStrategy implements OutputStrategy, RedrawLine {
27 readonly stream: NodeJS.WritableStream;
28 protected readonly colors: Colors;
29 protected readonly logUpdate: LogUpdate;
30 constructor({ stream, colors }?: LogUpdateOutputStrategyOptions);
31 redrawLine(msg?: string): void;
32 createTaskChain(): TaskChain;
33}