interface ICliTerminalWriter {
    wrapInBackgroundColor: (
        text: string,
        color: CliBackgroundColor,
    ) => string;
    wrapInColor: (text: string, color: CliForegroundColor) => string;
    writeError: (message: string) => void;
    writeInfo: (message: string) => void;
    writeJson: (json: any) => void;
    writeSuccess: (message: string) => void;
    writeToFile: (fileName: string, content: string) => void;
    writeWarning: (message: string) => void;
    write(text: string): void;
    writeDivider(
        options?: {
            char?: string;
            color?: CliForegroundColor;
            length?: number;
        },
    ): void;
    writeln(text?: string): void;
    writeObjectsAsTable(objects: any[]): void;
    writeTable(headers: string[], rows: string[][]): void;
}

Properties

wrapInBackgroundColor: (text: string, color: CliBackgroundColor) => string

Write a message to the terminal with the specified background color

Type declaration

wrapInColor: (text: string, color: CliForegroundColor) => string

Write a message to the terminal with the specified color

Type declaration

writeError: (message: string) => void

Write an error message to the terminal

Type declaration

    • (message: string): void
    • Parameters

      • message: string

        The message to write

      Returns void

      void

writeInfo: (message: string) => void

Write an info message to the terminal

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

      void

writeJson: (json: any) => void

Write a JSON object to the terminal

Type declaration

    • (json: any): void
    • Parameters

      • json: any

        The JSON object to write

      Returns void

      void

writeSuccess: (message: string) => void

Write a success message to the terminal

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

      void

writeToFile: (fileName: string, content: string) => void

Write content to a file

Type declaration

    • (fileName: string, content: string): void
    • Parameters

      • fileName: string

        The name of the file to write to

      • content: string

        The content to write to the file

      Returns void

      void

writeWarning: (message: string) => void

Write a warning message to the terminal

Type declaration

    • (message: string): void
    • Parameters

      • message: string

        The message to write

      Returns void

      void

Methods

  • Write text to the terminal followed by a newline

    Parameters

    • Optionaltext: string

      The text to write

    Returns void

  • Write an object array as a table to the terminal

    Parameters

    • objects: any[]

      The objects to write to the table

    Returns void

    void

  • Write a table to the terminal

    Parameters

    • headers: string[]

      The headers of the table

    • rows: string[][]

      The rows of the table

    Returns void

    void