import type { Mark, Span, Text, Tint, Tone } from "./doc.js"; import { type Glyphs } from "./glyphs.js"; export declare const ESC = "\u001B["; export declare const RESET = "\u001B[0m"; /** Reverse video: the terminal's own way to fill a cell behind its text. */ export declare const INVERT = "\u001B[7m"; export declare const COLUMN_GAP = 3; /** * Every marked node paints its mark in this gutter — a space, the mark, and * spaces to fill — so content after any mark starts at the same column. */ export declare const GUTTER_WIDTH = 5; /** * Preferred width of the key lane between the gutter and the value column, * matching the preferred width of a ledger's name column. */ export declare const KEY_WIDTH = 27; export declare const MIN_FIELD_VALUE_WIDTH = 12; /** `"unbounded"` paints natural widths: no wrapping, truncation, or padding to a terminal width. */ export type PaintWidth = number | "unbounded"; export interface PaintStyle { readonly width: PaintWidth; readonly colors: boolean; readonly glyphs?: Glyphs; /** * The spinner frame a running mark paints, which the live region advances on * each repaint. A still document leaves it out and takes the set's first * frame, so the same document paints the same way twice. */ readonly spinner?: string; /** Whether authored text may wrap. Live scenes disable it so row budgets stay exact. */ readonly wrap?: boolean; } export interface ResolvedStyle { readonly width: PaintWidth; readonly colors: boolean; readonly glyphs: Glyphs; readonly spinner: string; readonly wrap: boolean; /** * Cells before the value column that field values and callout asides share * across one document; below twice its preferred column it moves left to * keep half the terminal width for values. */ readonly valueColumn: number; } export declare const resolveStyle: (style: PaintStyle) => ResolvedStyle; export declare const toneCodes: Readonly>; export declare const tintCodes: Readonly>; export declare const colorCode: (span: Span) => string; export declare const styleSpan: (span: Span, colors: boolean) => string; export declare const paintSpans: (spans: ReadonlyArray, style: ResolvedStyle, inherited?: Tone) => string; export declare const paintValue: (value: Text, style: ResolvedStyle, inherited?: Tone) => string; /** Width left for content after `used` cells, never below one cell. */ export declare const remaining: (width: PaintWidth, used: number) => PaintWidth; export declare const fits: (width: PaintWidth, line: string) => boolean; /** Wrap and paint a value into lines without any indentation. */ export declare const paintLines: (value: Text, width: PaintWidth, style: ResolvedStyle, tone?: Tone) => ReadonlyArray; export declare const spaces: (count: number) => string; /** * Paint a value behind a first-line prefix, continuation lines behind `rest` * (defaulting to blank space as wide as `first`). */ export declare const paintPrefixed: (value: Text, style: ResolvedStyle, options: { readonly indent: number; readonly first: string; readonly rest?: string; readonly tone?: Tone; }) => ReadonlyArray; export declare const dim: (value: string, style: ResolvedStyle) => string; export declare const statusGlyph: (tone: Tone, glyphs: Glyphs) => string | undefined; /** * The glyph a ledger row's mark paints: a status glyph, a change operation, * or — while a unit is still in flight — the spinner frame or the waiting mark. */ export declare const markGlyph: (mark: Mark, style: ResolvedStyle) => string; /** A mark (or none) in the gutter, padded so content starts after it. */ export declare const gutter: (mark: string | undefined) => string; export declare const blankGutter: string; export declare const bold: (value: Text) => ReadonlyArray; export declare const joinedParts: (parts: ReadonlyArray<{ readonly text: Text; }>, glyphs: Glyphs) => ReadonlyArray; /** * Append a dim aside to the last line when it fits, else paint it wrapped on * lines of its own at `ownLineIndent`. */ export declare const withSupplement: (lines: ReadonlyArray, trailing: Text, style: ResolvedStyle, ownLineIndent: number, options?: { readonly gap?: string | ((last: string) => string); readonly ownLine?: Text; }) => ReadonlyArray; //# sourceMappingURL=paint-kit.d.ts.map