UNPKG

r3bl-ts-utils

Version:

The `r3bl-ts-utils` package is a set of useful TypeScript functions and classes that can be used in Node.js and browser environments. They are inspired by Kotlin stdlib, and Rust to write code as expressions rather than statements, colorized text, powerfu

37 lines (36 loc) 1.14 kB
import { FormatFn, TextColor } from "../tui-colors"; export declare const Formatter: Readonly<{ headerUnderlineFn: TextColor & FormatFn; headerFn: TextColor & FormatFn; headerMessageFn: TextColor & FormatFn; primaryFn: TextColor & FormatFn; secondaryFn: TextColor & FormatFn; }>; export interface ColorConsoleIF { (text: string): ColorConsole; call(text: string): ColorConsole; apply(text: string): ColorConsole; consoleLog(): void; consoleError(): void; toString(): string; } export declare class ColorConsole { private readonly myStyleFn; private myText; static create: (style: FormatFn) => ColorConsoleIF; constructor(style: FormatFn); call: (text: string) => ColorConsole; apply: (text: string) => ColorConsole; consoleLog: (prefixWithNewline?: boolean) => void; consoleLogInPlace: (printNewline?: boolean) => void; consoleError: () => void; toString: () => string; } export declare const Styles: { Primary: FormatFn; Secondary: FormatFn; }; export declare const StyledColorConsole: { Secondary: ColorConsoleIF; Primary: ColorConsoleIF; };