@thi.ng/text-format
Version:
Customizable color text formatting with presets for ANSI & HTML
60 lines • 1.77 kB
TypeScript
import type { HtmlFormatOpts, StringFormat } from "./api.js";
/**
* Constructs an HTML formatter using given config options and for use w/
* default format IDs only.
*
* @param opts -
*/
export declare const formatHtml: ({ colors, attrib, delim, fg, bg, bold, dim, underline, }: HtmlFormatOpts) => StringFormat;
/**
* Preset HTML string formatter for use w/ default format IDs, generating
* `<span>` elements with inline CSS.
*/
export declare const FMT_HTML_INLINE_CSS: StringFormat;
/**
* Preset HTML formatter for use w/ default format IDs, generating `<span>`
* elements with Tachyons CSS classes.
*/
export declare const FMT_HTML_TACHYONS: StringFormat;
/**
* Preset HTML formatter for use w/ default text format IDs, generating `<span>`
* elements with thi.ng/meta-css base framework color classes.
*/
export declare const FMT_HTML_MCSS: StringFormat;
/**
* Preset HTML formatter for use w/ default text format IDs, generating `<span>`
* elements with `style` attributes and given CSS variable names for defining
* colors.
*
* @remarks
* The color variable names must be given in this order:
*
* - black
* - red
* - green
* - yellow
* - blue
* - magenta
* - cyan
* - light gray
* - gray
* - light red
* - light green
* - light yellow
* - light blue
* - light magenta
* - light cyan
* - white
*
* @param varNames
*/
export declare const FMT_HTML_CSS_VARS: (varNames: string[]) => StringFormat;
/**
* Higher order custom HTML formatter for 16bit (RGB565) colors (without
* additional formatting flags). By default assigns text color, but can be
* assigned to any CSS property via given `prop` argument.
*
* @param prop -
*/
export declare const FMT_HTML565: (prop?: string) => StringFormat;
//# sourceMappingURL=html.d.ts.map