UNPKG

@visulima/ansi

Version:

ANSI escape codes for some terminal swag.

29 lines (28 loc) 1.18 kB
/** Escape character (\u001B). */ declare const ESC: string; /** Control Sequence Introducer (ESC [). */ declare const CSI: string; /** Operating System Command (ESC ]). */ declare const OSC: string; /** Bell character (\u0007). Often used to terminate OSC sequences. */ declare const BEL: string; /** Separator used in some ANSI sequences, typically a semicolon. */ declare const SEP: string; /** Device Control String (ESC P). */ declare const DCS: string; /** String Terminator (ESC \\). Used to terminate DCS, SOS, PM, APC sequences. */ declare const ST: string; /** Application Program Command (ESC _). */ declare const APC: string; /** Start of String (ESC X). */ declare const SOS: string; /** Privacy Message (ESC ^). */ declare const PM: string; /** * Strips OSC terminators (BEL, ESC) from a caller-supplied value so it cannot * inject or prematurely terminate an escape sequence when interpolated into one. * @param value The untrusted string to sanitize. * @returns `value` with all BEL and ESC characters removed. */ declare const stripOscTerminators: (value: string) => string; export { APC, BEL, CSI, DCS, ESC, OSC, PM, SEP, SOS, ST, stripOscTerminators };