export declare function stripAnsi(value: string): string; /** * Prevent programming-font ligatures with a visible, measured separator. * Ink's painter allocates at least one cell even for zero-width code points, * so U+200B/U+200C would make Yoga and the output grid disagree. */ export declare function breakTerminalLigatures(value: string): string; /** * Convert untrusted command/tool text into terminal-safe printable content. * * Ink measures control characters differently from a physical terminal: a * literal tab is effectively zero-width to Yoga but expands to the next tab * stop when Windows Terminal receives it. Cursor/erase escape sequences are * worse because they can paint outside the component that owns the text. * Normalize tabs to a small fixed separator, remove terminal escapes, and * retain only printable characters plus newlines before layout is measured. */ export declare function sanitizeTerminalText(value: string, tabWidth?: number): string; export declare function displayWidth(value: string): number; export declare function truncateDisplay(value: string, maxWidth: number, ellipsis?: string): string; export declare function truncateDisplayStart(value: string, maxWidth: number, ellipsis?: string): string; /** Split without bisecting a grapheme cluster; input is expected to be ANSI-free. */ export declare function splitDisplay(value: string, maxWidth: number): [head: string, tail: string]; export declare function padDisplayEnd(value: string, width: number): string; export declare function frameRule(width: number, leftLabel: string, rightLabel?: string, edge?: 'top' | 'bottom'): string; /** * Structural split of a top/bottom frame rule that reserves — but does not * render — the right-hand label slot. Unlike {@link frameRule} (which bakes the * right label into a single string), this returns the rule as `head` + `tail` * with a fixed-width gap of `reservedRightWidth` columns between them, so a * caller can render an animated / per-glyph-colored chip into that gap while * keeping the total rule width identical to `frameRule`. * * Geometry mirrors `frameRule` exactly: * `head` = `╭─ {left} ` + fill + one leading space of the suffix * gap = `reservedRightWidth` columns (caller fills these) * `tail` = ` ─` + right corner * * Invariant: `displayWidth(head) + reservedRightWidth + displayWidth(tail) === width` * for any `width ≥ 2` and any reserved width (the chip's live content — spinner, * rolling word, growing dots — must be padded to exactly `reservedRightWidth` by * the caller so the right corner never jitters). */ export declare function frameRuleParts(width: number, leftLabel: string, reservedRightWidth: number, edge?: 'top' | 'bottom'): { head: string; tail: string; }; //# sourceMappingURL=terminal-width.d.ts.map