/** * Minimal ANSI toolkit. No dependencies, no global mutation of the stream. */ export declare function isColorEnabled(): boolean; export declare function setColorEnabled(value: boolean): void; export type Styler = (input: string) => string; export declare const bold: Styler; export declare const dim: Styler; export declare const italic: Styler; export declare const underline: Styler; export declare const inverse: Styler; /** 256-colour foreground. Degrades to plain text when colour is off. */ export declare function fg(code: number): Styler; /** 256-colour background. */ export declare function bg(code: number): Styler; export declare const cursor: { hide: string; show: string; up: (n: number) => string; toStart: string; eraseDown: string; }; /** * DEC private mode 2026 ("synchronized output"). Terminals that honour it * buffer everything between start/end and paint it as one frame, so an * erase-then-redraw pair never shows a blank frame in between. */ export declare const sync: { start: string; end: string; }; /** * Windows Terminal's DirectX renderer presents writes eagerly enough that an * erase and a redraw can each land as a visible frame — that's what `sync` * exists to fix. Most other terminals coalesce writes on their own and don't * need the hint, and at least one (WebStorm's JediTerm) appears to mishandle * the unrecognised `CSI ? 2026` sequence rather than the usual "ignore * unknown private mode" behaviour, stalling the live region until something * else forces a redraw. So keep this opt-in to the one terminal it's for, * rather than sending it everywhere and hoping every parser ignores it. */ export declare function supportsSyncOutput(): boolean; export declare function stripAnsi(input: string): string; /** * Terminal cell width. Handles the wide-character ranges that actually turn up * in CLI output (CJK, emoji) and treats combining marks as zero-width. */ export declare function stringWidth(input: string): number; /** * Truncate to a visible width while keeping escape sequences intact, so a * clipped line never leaks colour into the rest of the frame. */ export declare function truncate(input: string, max: number): string; /** * Word-wrap to a visible width, returning plain lines. * * Errors must never be clipped — the useful half of a message like npm's 403 * lives at the end of the line. Callers style each returned line themselves, * which sidesteps splitting an escape sequence across a break. */ export declare function wrapText(input: string, width: number): string[]; export declare function padEnd(input: string, target: number): string; //# sourceMappingURL=ansi.d.ts.map