@juparog/print-table
Version:
print-table is a simple library that allows you to print beautiful and customizable tables in the console using ANSI escape codes. It is ideal for displaying tabular data in a clear and visually appealing way.
92 lines (91 loc) • 2.1 kB
TypeScript
/**
* Escape code used for control sequences.
*/
export declare const ESC_CODE = "\u001B";
export declare const CSI_CODE = "[";
export declare const END_CODE = "m";
/**
* Colors / Graphics mode
*/
export declare const RESET_ALL_MODES = "0";
export declare const BOLD_MODE = "1";
export declare const FAINT_MODE = "2";
export declare const ITALICIZE_MODE = "3";
export declare const UNDERLINE_MODE = "4";
export declare const SLOW_BLINK_MODE = "5";
export declare const RAPID_BLINK_MODE = "6";
export declare const INVERSE_MODE = "7";
export declare const HIDDEN_MODE = "8";
export declare const STRIKE_THROUGH_MODE = "9";
/**
* Foreground colors
*/
export declare enum ForegroundColor {
BLACK = "30",
RED = "31",
GREEN = "32",
YELLOW = "33",
BLUE = "34",
MAGENTA = "35",
CYAN = "36",
WHITE = "37"
}
/**
* Bright foreground colors
*/
export declare enum BrightForegroundColor {
BRIGHT_BLACK = "90",
BRIGHT_RED = "91",
BRIGHT_GREEN = "92",
BRIGHT_YELLOW = "93",
BRIGHT_BLUE = "94",
BRIGHT_MAGENTA = "95",
BRIGHT_CYAN = "96",
BRIGHT_WHITE = "97"
}
/**
* Background colors
*/
export declare enum BgColor {
BLACK = "40",
RED = "41",
GREEN = "42",
YELLOW = "43",
BLUE = "44",
MAGENTA = "45",
CYAN = "46",
WHITE = "47"
}
/**
* Bright background colors
*/
export declare enum BrightBgColor {
BRIGHT_BLACK = "90",
BRIGHT_RED = "91",
BRIGHT_GREEN = "92",
BRIGHT_YELLOW = "93",
BRIGHT_BLUE = "94",
BRIGHT_MAGENTA = "95",
BRIGHT_CYAN = "96",
BRIGHT_WHITE = "97"
}
/**
* Alignment of the text in a table cell.
*/
export declare enum AlignmentText {
LEFT = "left",
CENTER = "center",
RIGHT = "right",
TOP = "top",
MIDDLE = "middle",
BOTTOM = "bottom",
LEFT_TOP = "left-top",
LEFT_MIDDLE = "left-middle",
LEFT_BOTTOM = "left-bottom",
CENTER_TOP = "center-top",
CENTER_MIDDLE = "center-middle",
CENTER_BOTTOM = "center-bottom",
RIGHT_TOP = "right-top",
RIGHT_MIDDLE = "right-middle",
RIGHT_BOTTOM = "right-bottom"
}