bananass-utils-console
Version:
Console Utilities for Bananass Framework.🍌
61 lines (60 loc) • 2.49 kB
TypeScript
/**
* Returns a green-colored success message prefixed with an icon.
*
* @param {string} str The success message to format.
* @param {boolean} showIcon Whether to show the icon. Defaults to `false`.
* @returns {string} Returns a green-colored success message prefixed with an icon.
*
* @example
* console.log(complete('Operation successful.'));
* // Output: (icon?) Operation successful. (displayed in green text in the terminal.)
*/
export function success(str: string, showIcon?: boolean): string;
/**
* Returns a red-colored error message prefixed with an icon.
*
* @param {string} str The error message to format.
* @param {boolean} showIcon Whether to show the icon. Defaults to `false`.
* @returns {string} Returns a red-colored error message prefixed with an icon.
*
* @example
* console.log(error('Something went wrong.'));
* // Output: (icon?) Something went wrong. (displayed in red text in the terminal.)
*/
export function error(str: string, showIcon?: boolean): string;
/**
* Returns a yellow-colored warning message prefixed with an icon.
*
* @param {string} str The warning message to format.
* @param {boolean} showIcon Whether to show the icon. Defaults to `false`.
* @returns {string} Returns a yellow-colored warning message prefixed with an icon.
*
* @example
* console.log(warning('This is a warning.'));
* // Output: (icon?) This is a warning. (displayed in yellow text in the terminal.)
*/
export function warning(str: string, showIcon?: boolean): string;
/**
* Returns a blue-colored info message prefixed with an icon.
*
* @param {string} str The info message to format.
* @param {boolean} showIcon Whether to show the icon. Defaults to `false`.
* @returns {string} Returns a blue-colored info message prefixed with an icon.
*
* @example
* console.log(info('Informational message.'));
* // Output: (icon?) Informational message. (displayed in blue text in the terminal.)
*/
export function info(str: string, showIcon?: boolean): string;
/**
* Returns a yellow-colored error message prefixed with an icon.
*
* @param {string} str The bananass message to format.
* @param {boolean} showIcon Whether to show the icon. Defaults to `false`.
* @returns Returns a yellow-colored error message prefixed with an icon.
*
* @example
* console.log(bananass('Hello, Bananass.'));
* // Output: (icon?) Hello, Bananass. (displayed in yellow text in the terminal.)
*/
export function bananass(str: string, showIcon?: boolean): string;