declare function visualWidth(s: string): number;
declare function stripAnsi(s: string): string;
export type Style = {
    fgColor?: string;
    bgColor?: string;
    bold?: boolean;
    italic?: boolean;
    dim?: boolean;
    underline?: boolean;
};
export type Align = "start" | "center" | "end";
declare function colorToRgb(c: string): [number, number, number] | null;
declare function sgr(style: Style): string;
export declare class Block {
    readonly lines: readonly string[];
    private constructor();
    static empty(): Block;
    static of(content: string | string[]): Block;
    get height(): number;
    get width(): number;
    toString(): string;
}
declare function padLine(line: string, w: number, align?: Align): string;
export declare function pad(block: Block, w: number, h: number, hAlign?: Align, vAlign?: Align): Block;
export declare function styled(block: Block, style: Style): Block;
export declare function beside(left: Block, right: Block): Block;
export declare function above(top: Block, bottom: Block): Block;
export type BorderStyle = "rounded" | "heavy" | "double" | "light";
type BorderChars = {
    tl: string;
    tr: string;
    bl: string;
    br: string;
    h: string;
    v: string;
};
declare function resolveBorderStyle(s: string | undefined): BorderStyle;
export type BorderOpts = {
    borderStyle?: BorderStyle;
    borderColor?: string;
    padding?: number;
    title?: string;
    titleColor?: string;
};
export declare function bordered(block: Block, opts: BorderOpts): Block;
export type NodeType = "box" | "row" | "column" | "text" | "raw" | "space" | "hline" | "vline";
export type LayoutNode = {
    type: NodeType;
    attrs: Record<string, unknown>;
    children: LayoutNode[];
};
declare function styleOf(attrs: Record<string, unknown>): Style;
export declare function renderNode(node: LayoutNode): Block;
export declare function render(node: LayoutNode): string;
export declare function _render(node: LayoutNode, color: "auto" | boolean): string;
export declare const _internal: {
    visualWidth: typeof visualWidth;
    sgr: typeof sgr;
    padLine: typeof padLine;
    stripAnsi: typeof stripAnsi;
    colorToRgb: typeof colorToRgb;
    BORDER_CHARS: Record<BorderStyle, BorderChars>;
    resolveBorderStyle: typeof resolveBorderStyle;
    styleOf: typeof styleOf;
    RENDERERS: Record<NodeType, (n: LayoutNode) => Block>;
};
export {};
