import type { Element, Style } from "./elements.js"; declare const paintedBrand: unique symbol; /** Text prepared for the style parser by paint or paintAnsi. */ export type Painted = string & { readonly [paintedBrand]: true; }; export type PaintStyle = { fg?: string; bg?: string; bold?: boolean; dim?: boolean; }; export type Piece = { text: string; style?: PaintStyle; }; export type SegmentOptions = { align?: "left" | "right"; style?: PaintStyle; }; export declare const EMPTY: Painted; export declare function paint(text: string, style?: PaintStyle): Painted; /** For text that already carries ANSI color, such as std::syntax output. * Braces are escaped; escape sequences are left for the parser to read. */ export declare function paintAnsi(text: string): Painted; export declare function joinPainted(...parts: Painted[]): Painted; export declare function visibleWidth(content: Painted): number; /** Clip plain text to `width` cells with a trailing ellipsis. */ export declare function clipText(text: string, width: number): string; export declare function padPainted(content: Painted, width: number, align?: "left" | "right", style?: PaintStyle): Painted; /** Clip painted content by visible width, preserving its colors. */ export declare function clipPainted(content: Painted, width: number): Painted; /** Content flattened to one line, clipped or padded to exactly `width`. * A string and its padding receive `options.style`. Pieces carry their own * styles; `options.style` applies only to padding when content is pieces. */ export declare function segment(content: string | Piece[], width: number, options?: SegmentOptions): Painted; export declare function paintedLine(content: Painted, style?: Style): Element; export {};