UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

52 lines (51 loc) 1.67 kB
export declare const enum FontStyles { Bold = 1, Faint = 2, Italic = 3, Underline = 4 } export declare const enum Colors { Black = 0, Red = 1, Green = 2, Yellow = 3, Blue = 4, Magenta = 5, Cyan = 6, White = 7 } export declare enum ColorEffect { Foreground = 30, Background = 40 } export type FormatOptions = ColorFormatOptions | WeightFormatOptions | ColorFormatOptions & WeightFormatOptions; export interface ColorFormatOptions { color: Colors; effect: ColorEffect; } export interface WeightFormatOptions { style: FontStyles; } export interface OutputFormatter { format(input: string, options?: FormatOptions): string; getFormatString(options?: FormatOptions): string; reset(): string; } export declare const voidFormatter: OutputFormatter; export declare const markdownFormatter: OutputFormatter; /** * This does not work if the {@link setFormatter|formatter} is void. Tries to format the text with a bold font weight. */ export declare function italic(s: string, f?: OutputFormatter, options?: FormatOptions): string; /** * This does not work if the {@link setFormatter|formatter} is void. Tries to format the text with an italic font shape. */ export declare function bold(s: string, f?: OutputFormatter, options?: FormatOptions): string; export declare const escape = "\u001B["; export declare const ansiFormatter: { reset(): string; format(input: string, options?: FormatOptions): string; getFormatString(options?: FormatOptions): string; }; export declare let formatter: OutputFormatter; export declare function setFormatter(setFormatter: OutputFormatter): void;