UNPKG

5.6 kBTypeScriptView Raw
1import * as Gulp from 'gulp';
2import { IBuildConfig } from './IBuildConfig';
3/**
4 * Adds a message to be displayed in the summary after execution is complete.
5 * @param value - the message to display
6 * @public
7 */
8export declare function logSummary(value: string): void;
9/**
10 * Log a message to the console
11 * @param args - the messages to log to the console
12 * @public
13 */
14export declare function log(...args: string[]): void;
15/**
16 * Resets the state of the logging cache
17 * @public
18 */
19export declare function reset(): void;
20/**
21 * The result of a functional test run
22 * @public
23 */
24export declare enum TestResultState {
25 Passed = 0,
26 Failed = 1,
27 FlakyFailed = 2,
28 Skipped = 3
29}
30/**
31 * Store a single functional test run's information
32 * @param name - the name of the test
33 * @param result - the result of the test
34 * @param duration - the length of time it took for the test to execute
35 * @public
36 */
37export declare function functionalTestRun(name: string, result: TestResultState, duration: number): void;
38/** @public */
39export declare function endTaskSrc(taskName: string, startHrtime: [number, number], fileCount: number): void;
40/**
41 * Store coverage information, potentially logging an error if the coverage is below the threshold
42 * @param coverage - the coverage of the file as a percentage
43 * @param threshold - the minimum coverage for the file as a percentage, an error will be logged if coverage is below
44 * the threshold
45 * @param filePath - the path to the file whose coverage is being measured
46 * @public
47 */
48export declare function coverageData(coverage: number, threshold: number, filePath: string): void;
49/**
50 * Adds a suppression for an error or warning
51 * @param suppression - the error or warning as a string or Regular Expression
52 * @public
53 */
54export declare function addSuppression(suppression: string | RegExp): void;
55/**
56 * Logs a warning. It will be logged to standard error and cause the build to fail
57 * if buildConfig.shouldWarningsFailBuild is true, otherwise it will be logged to standard output.
58 * @param message - the warning description
59 * @public
60 */
61export declare function warn(...args: string[]): void;
62/**
63 * Logs an error to standard error and causes the build to fail.
64 * @param message - the error description
65 * @public
66 */
67export declare function error(...args: string[]): void;
68/**
69 * Logs a message about a particular file
70 * @param write - the function which will write message
71 * @param taskName - the name of the task which is doing the logging
72 * @param filePath - the path to the file which encountered an issue
73 * @param line - the line in the file which had an issue
74 * @param column - the column in the file which had an issue
75 * @param errorCode - the custom error code representing this error
76 * @param message - a description of the error
77 * @public
78 */
79export declare function fileLog(write: (text: string) => void, taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void;
80/**
81 * Logs a warning regarding a specific file.
82 * @param filePath - the path to the file which encountered an issue
83 * @param line - the line in the file which had an issue
84 * @param column - the column in the file which had an issue
85 * @param warningCode - the custom warning code representing this warning
86 * @param message - a description of the warning
87 * @public
88 */
89export declare function fileWarning(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void;
90/**
91 * Logs an error regarding a specific file to standard error and causes the build to fail.
92 * @param filePath - the path to the file which encountered an issue
93 * @param line - the line in the file which had an issue
94 * @param column - the column in the file which had an issue
95 * @param errorCode - the custom error code representing this error
96 * @param message - a description of the error
97 * @public
98 */
99export declare function fileError(taskName: string, filePath: string, line: number, column: number, errorCode: string, message: string): void;
100/**
101 * Logs a message to standard output if the verbose flag is specified.
102 * @param args - the messages to log when in verbose mode
103 * @public
104 */
105export declare function verbose(...args: string[]): void;
106/** @public */
107export declare function generateGulpError(err: any): any;
108/**
109 * Logs an error to standard error and causes the build to fail.
110 * @param e - the error (can be a string or Error object)
111 * @public
112 */
113export declare function writeError(e: any): void;
114/**
115 * Returns the list of warnings which have been logged
116 * @public
117 */
118export declare function getWarnings(): string[];
119/**
120 * Returns the list of errors which have been logged
121 * @public
122 */
123export declare function getErrors(): string[];
124/** @public */
125export declare function getStart(): [number, number] | undefined;
126/**
127 * @public
128 */
129export declare function setWatchMode(): void;
130/**
131 * @public
132 */
133export declare function getWatchMode(): boolean | undefined;
134/**
135 * @public
136 */
137export declare function setExitCode(exitCode: number): void;
138/**
139 * @public
140 */
141export declare function logStartSubtask(name: string): void;
142/**
143 * @public
144 */
145export declare function logEndSubtask(name: string, startTime: [number, number], errorObject?: Error): void;
146/**
147 * @public
148 */
149export declare function initialize(gulp: typeof Gulp, config: IBuildConfig, gulpErrorCallback?: (err: Error) => void, gulpStopCallback?: (err: Error) => void): void;
150/**
151 * @public
152 */
153export declare function markTaskCreationTime(): void;
154//# sourceMappingURL=logging.d.ts.map
\No newline at end of file