functionalscript
Version:
FunctionalScript is a purely functional subset of JavaScript
32 lines (31 loc) • 1.29 kB
TypeScript
import type { Io, Writable } from "../../io/module.f.ts";
export declare const backspace: string;
type End = 'm';
type Csi = (code: number | string) => string;
/**
* Control Sequence Introducer (CSI) escape sequence.
* https://en.wikipedia.org/wiki/ANSI_escape_code#Control_Sequence_Introducer_commands
*
* @param end - The final character that indicates the type of sequence.
* @returns A function that takes a code (number or string) and returns the complete ANSI escape sequence.
*/
export declare const csi: (end: End) => Csi;
/**
* Specialization of CSI for Select Graphic Rendition (SGR) sequences.
* https://en.wikipedia.org/wiki/ANSI_escape_code#SGR
*/
export declare const sgr: Csi;
export declare const reset: string;
export declare const bold: string;
export declare const fgRed: string;
export declare const fgGreen: string;
export type Stdout = {
readonly write: (s: string) => void;
};
export type WriteText = (text: string) => WriteText;
export declare const createConsoleText: (stdout: Stdout) => WriteText;
export type CsiConsole = (s: string) => void;
export declare const console: ({ fs: { writeSync } }: Io) => (w: Writable) => CsiConsole;
export declare const stdio: (io: Io) => CsiConsole;
export declare const stderr: (io: Io) => CsiConsole;
export {};