/** * Supported foreground color names. */ export type ForegroundColorName = "black" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright"; /** * Supported background color names. */ export type BackgroundColorName = "bgBlack" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright"; /** * Type representing the target of the color application (foreground or * background). */ type ColorType = "foreground" | "background"; /** * Applies a color to a string using Ansis. * Supports named colors, hex codes, RGB values, and ANSI-256 color codes. * * @param str - The string to colorize. * @param color - The color to apply. * @param type - Whether to apply the color to the foreground or background. * @returns The colorized string. */ import { type AnsiCode } from "../types/ansi.js"; /** * Gets the ANSI style for a color. */ export declare const getStyle: (color: string | undefined, type: ColorType) => AnsiCode | undefined; export declare const colorize: (str: string, color: string | undefined, type: ColorType) => string; export {};