UNPKG

1.68 kBTypeScriptView Raw
1import * as chalk from 'chalk';
2export interface CLIErrorMessageConfig {
3 title: string;
4 bodyLines?: string[];
5 slug?: string;
6}
7export interface CLIWarnMessageConfig {
8 title: string;
9 bodyLines?: string[];
10 slug?: string;
11}
12export interface CLINoteMessageConfig {
13 title: string;
14 bodyLines?: string[];
15}
16export interface CLISuccessMessageConfig {
17 title: string;
18 bodyLines?: string[];
19}
20declare class CLIOutput {
21 private readonly NX_PREFIX;
22 /**
23 * Longer dash character which forms more of a continuous line when place side to side
24 * with itself, unlike the standard dash character
25 */
26 private readonly VERTICAL_SEPARATOR;
27 /**
28 * Expose some color and other utility functions so that other parts of the codebase that need
29 * more fine-grained control of message bodies are still using a centralized
30 * implementation.
31 */
32 colors: {
33 gray: chalk.Chalk;
34 };
35 bold: chalk.Chalk;
36 underline: chalk.Chalk;
37 private writeToStdOut;
38 private writeOutputTitle;
39 private writeOptionalOutputBody;
40 addNewline(): void;
41 addVerticalSeparator(): void;
42 addVerticalSeparatorWithoutNewLines(): void;
43 error({ title, slug, bodyLines }: CLIErrorMessageConfig): void;
44 warn({ title, slug, bodyLines }: CLIWarnMessageConfig): void;
45 note({ title, bodyLines }: CLINoteMessageConfig): void;
46 success({ title, bodyLines }: CLISuccessMessageConfig): void;
47 logSingleLine(message: string): void;
48 logCommand(message: string, isCached?: boolean): void;
49 log({ title, bodyLines }: CLIWarnMessageConfig): void;
50}
51export declare const output: CLIOutput;
52export {};