rsformat
Version:
Formatting/printing library for JavaScript that takes after rust's string formatting
38 lines (37 loc) • 1.65 kB
TypeScript
/// <reference types="node" />
import { Writable } from 'node:stream';
export declare function Printer(outStream?: Writable, errStream?: Writable, options?: {
debugColors: boolean;
}): {
/**
* Print a format string to an output stream (usually process.stdout).
*
* @param format_string String used for formatting
* @param params Parameters to be inserted into the format string
*/
print: (format_string: string, ...params: any[]) => void;
/**
* Print a format string to an output stream (usually process.stdout)
* and append a newline.
*
* @param format_string String used for formatting
* @param params Parameters to be inserted into the format string
*/
println: (format_string: string, ...params: any[]) => void;
/**
* Print a format string to an error stream (usually process.stderr).
*
* @param format_string String used for formatting
* @param params Parameters to be inserted into the format string
*/
eprint: (format_string: string, ...params: any[]) => void;
/**
* Print a format string to an error stream (usually process.stderr)
* and append a newline.
*
* @param format_string String used for formatting
* @param params Parameters to be inserted into the format string
*/
eprintln: (format_string: string, ...params: any[]) => void;
};
export declare const print: (format_string: string, ...params: any[]) => void, println: (format_string: string, ...params: any[]) => void, eprint: (format_string: string, ...params: any[]) => void, eprintln: (format_string: string, ...params: any[]) => void;