@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
60 lines • 1.4 kB
TypeScript
/**
* Colorize a string with the specified color
*/
export declare function colorize(text: string, color: ColorName): string;
/**
* Create a success message (green)
*/
export declare function success(text: string): string;
/**
* Create a warning message (yellow)
*/
export declare function warning(text: string): string;
/**
* Create an error message (red)
*/
export declare function error(text: string): string;
/**
* Create an info message (cyan)
*/
export declare function info(text: string): string;
/**
* Create a dim/muted message (gray)
*/
export declare function dim(text: string): string;
/**
* ANSI color codes for terminal output
* Provides consistent coloring for CLI messages
*/
export declare const colors: {
// Reset
reset: '\x1B[0m';
// Text styles
bright: '\x1B[1m';
dim: '\x1B[2m';
underscore: '\x1B[4m';
blink: '\x1B[5m';
reverse: '\x1B[7m';
hidden: '\x1B[8m';
// Foreground colors
black: '\x1B[30m';
red: '\x1B[31m';
green: '\x1B[32m';
yellow: '\x1B[33m';
blue: '\x1B[34m';
magenta: '\x1B[35m';
cyan: '\x1B[36m';
white: '\x1B[37m';
gray: '\x1B[90m';
// Background colors
bgBlack: '\x1B[40m';
bgRed: '\x1B[41m';
bgGreen: '\x1B[42m';
bgYellow: '\x1B[43m';
bgBlue: '\x1B[44m';
bgMagenta: '\x1B[45m';
bgCyan: '\x1B[46m';
bgWhite: '\x1B[47m';
bgGray: '\x1B[100m'
};
export type ColorName = keyof typeof colors