export declare const stripTerminalFormatting: (value: string) => string; export declare const displayWidth: (value: string) => number; /** * Terminal rows a line of this display width fills at the given terminal * width. A line the terminal rewrapped fills more rows than the single row it * was painted as, which is what erasing it again has to cover. */ export declare const renderedRows: (width: number, columns: number) => number; /** * Shorten a painted line to `width` cells, keeping its terminal formatting and * marking the cut with an ellipsis. Styling and hyperlinks the line opened are * closed at the cut, because the sequences that would have closed them are * gone. A line already within the width is returned untouched. */ export declare const truncateLine: (value: string, width: number, ellipsis?: string) => string; export declare const padDisplay: (value: string, width: number, align?: "left" | "right") => string; /** The longest prefix of `value` no wider than `width`, never splitting a grapheme. */ export declare const takeDisplayStart: (value: string, width: number) => string; /** The longest suffix of `value` no wider than `width`, never splitting a grapheme. */ export declare const takeDisplayEnd: (value: string, width: number) => string; /** * Where a value gives way when it is wider than its column: `"end"` keeps the * start, `"middle"` keeps both ends. A name shortens in the middle so its * scope and its last path segment — the parts that tell two names apart — * both survive. */ export type TruncateMode = "end" | "middle"; export declare const truncateDisplay: (value: string, width: number, mode?: TruncateMode, ellipsis?: string) => string; export declare const wrapDisplay: (value: string, width: number) => ReadonlyArray; //# sourceMappingURL=width.d.ts.map