@isdk/artistic-text
Version:
Generates artistic text with custom fonts and color.
28 lines (25 loc) • 1.05 kB
TypeScript
import figlet from 'figlet';
interface ArtisticTextOptions extends figlet.Options {
color?: string;
}
/**
* Generates artistic text with custom fonts and colors.
*
* This function create styled text with a random or specified font, and applies color.
*
* @param {string} s - The text to be styled.
* @param {ArtisticTextOptions} [options={}] - Optional configuration for the text styling.
* @param {string} [options.color='gray'] - The color to apply to the text. Use 'none' for no color.
* @param {string} [options.font] - The font to use for the text. If not provided, a random font is selected.
* @returns {string} The styled text.
*
* @example
* // Generate text with a random font and gray color
* console.log(artisticText('Hello World'));
*
* @example
* // Generate text with a specific font and color
* console.log(artisticText('Hello World', { font: '3D-ASCII', color: 'blue' }));
*/
declare function artisticText(s: string, options?: ArtisticTextOptions): string;
export { type ArtisticTextOptions, artisticText };