UNPKG

3.29 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Writable } from 'stream';
3import { Configuration } from './Configuration';
4import { MessageName } from './MessageName';
5import { Report } from './Report';
6import { Locator } from './types';
7export declare type StreamReportOptions = {
8 configuration: Configuration;
9 forgettableBufferSize?: number;
10 forgettableNames?: Set<MessageName | null>;
11 includeFooter?: boolean;
12 includeInfos?: boolean;
13 includeLogs?: boolean;
14 includeWarnings?: boolean;
15 json?: boolean;
16 stdout: Writable;
17};
18export declare function formatName(name: MessageName | null, { configuration, json }: {
19 configuration: Configuration;
20 json: boolean;
21}): any;
22export declare function formatNameWithHyperlink(name: MessageName | null, { configuration, json }: {
23 configuration: Configuration;
24 json: boolean;
25}): any;
26export declare class StreamReport extends Report {
27 static start(opts: StreamReportOptions, cb: (report: StreamReport) => Promise<void>): Promise<StreamReport>;
28 private configuration;
29 private includeFooter;
30 private includeInfos;
31 private includeWarnings;
32 private json;
33 private stdout;
34 private cacheHitCount;
35 private cacheMissCount;
36 private warningCount;
37 private errorCount;
38 private startTime;
39 private indent;
40 private progress;
41 private progressTime;
42 private progressFrame;
43 private progressTimeout;
44 private forgettableBufferSize;
45 private forgettableNames;
46 private forgettableLines;
47 constructor({ configuration, stdout, json, includeFooter, includeLogs, includeInfos, includeWarnings, forgettableBufferSize, forgettableNames, }: StreamReportOptions);
48 hasErrors(): boolean;
49 exitCode(): 0 | 1;
50 reportCacheHit(locator: Locator): void;
51 reportCacheMiss(locator: Locator, message?: string): void;
52 startTimerSync<T>(what: string, cb: () => T): T;
53 startTimerPromise<T>(what: string, cb: () => Promise<T>): Promise<T>;
54 startCacheReport<T>(cb: () => Promise<T>): Promise<T>;
55 reportSeparator(): void;
56 reportInfo(name: MessageName | null, text: string): void;
57 reportWarning(name: MessageName, text: string): void;
58 reportError(name: MessageName, text: string): void;
59 reportProgress(progressIt: AsyncIterable<{
60 progress: number;
61 title?: string;
62 }>): {
63 stop: () => void;
64 then<TResult1 = void, TResult2 = never>(onfulfilled?: ((value: void) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
65 catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<void | TResult>;
66 [Symbol.toStringTag]: string;
67 finally(onfinally?: (() => void) | null | undefined): Promise<void>;
68 };
69 reportJson(data: any): void;
70 finalize(): Promise<void>;
71 private writeLine;
72 private writeLineWithForgettableReset;
73 private writeLines;
74 private reportCacheChanges;
75 private clearProgress;
76 private writeProgress;
77 private refreshProgress;
78 private formatTiming;
79 private truncate;
80 private formatName;
81 private formatNameWithHyperlink;
82 private formatIndent;
83}
84
\No newline at end of file