/**
 * Terminal display-width helpers.
 *
 * `String.length` is the wrong ruler for a terminal: it over-counts ANSI colour
 * escapes (chalk output) and under-counts wide glyphs (CJK, emoji) which occupy
 * two cells. The result is the drifting, wrapping session-table line users see
 * under tmux and over `--device` SSH. Every renderer that sizes a session-table
 * cell measures and truncates through this module so alignment is computed once,
 * correctly, from the same source of truth.
 */
/** Strip SGR colour + OSC-8 hyperlink escapes so width is measured on visible characters only. */
export declare function stripAnsi(s: string): string;
/** Visible display width of a string, ANSI-aware and wide-char-aware. */
export declare function stringWidth(s: string): number;
/**
 * Truncate to a target display width, appending '…' when shortened. Operates on
 * the visible (ANSI-stripped) string; callers colour the result afterwards so
 * the ellipsis is never inserted mid-escape.
 */
export declare function truncateToWidth(s: string, max: number): string;
/** Right-pad with spaces to a target display width. Never truncates. */
export declare function padToWidth(s: string, width: number): string;
/**
 * Effective terminal width. Reads `$COLUMNS` first so it survives tmux and
 * `--device` SSH (where `process.stdout.columns` is unset or wrong), falls back to
 * the TTY's reported width, then to `fallback`. Clamped to a sane band so a
 * bogus value can't produce a 0-wide or absurdly long table.
 */
export declare function terminalWidth(fallback?: number): number;
