/** * Box Formatter Service * * Centralized service for creating consistent box-drawing elements throughout the CLI. * Provides single-line boxes for content and double-line boxes for headers. * Follows dependency injection pattern and separation of concerns. * * Provides: * - Single-line boxes for content (progress, code blocks, tables) * - Double-line boxes for headers (via HeaderFormatter) * - Consistent box-drawing characters * - Color theming support */ import { type Color } from './color-adapter.interface.js'; /** * Box style types */ export type BoxStyle = 'double' | 'single'; /** * Box border characters for different styles */ interface BoxChars { bottomJunction: string; bottomLeft: string; bottomRight: string; cross: string; horizontal: string; leftJunction: string; rightJunction: string; topJunction: string; topLeft: string; topRight: string; vertical: string; } /** * Options for box formatting */ export interface BoxOptions { /** * Color for box borders * @default 'gray' */ color?: Color; /** * Box style (single or double line) * @default 'single' */ style?: BoxStyle; /** * Minimum width of the box * @default 40 */ minWidth?: number; /** * Maximum width of the box * @default 80 */ maxWidth?: number; /** * Fixed width (overrides min/max) */ width?: number; /** * Padding inside the box * @default 1 */ padding?: number; } /** * Box Formatter Service * * Provides consistent box-drawing across the CLI application. */ export declare class BoxFormatter { private readonly defaultOptions; /** * Box characters for different styles */ private readonly boxChars; /** * Create a simple box with content * * @param content - Lines of content to display * @param options - Box formatting options * @returns Formatted box string */ formatBox(content: string[], options?: BoxOptions): string; /** * Create a box with a title * * @param title - Title text * @param content - Lines of content to display * @param options - Box formatting options * @returns Formatted box string */ formatBoxWithTitle(title: string, content: string[], options?: BoxOptions): string; /** * Create a box border (top, bottom, or separator) * * @param type - Type of border ('top' | 'bottom' | 'separator') * @param width - Width of the border * @param options - Box formatting options * @returns Formatted border string */ formatBorder(type: 'bottom' | 'separator' | 'top', width: number, options?: Pick): string; /** * Create table borders * * @param columnWidths - Array of column widths * @param type - Type of border ('top' | 'bottom' | 'separator') * @param options - Box formatting options * @returns Formatted table border string */ formatTableBorder(columnWidths: number[], type: 'bottom' | 'separator' | 'top', options?: Pick): string; /** * Create a box line (content line with borders) * * @param content - Content string * @param width - Total width * @param options - Box formatting options * @returns Formatted line string */ formatBoxLine(content: string, width: number, options?: BoxOptions): string; /** * Get the box characters for a given style * * @param style - Box style * @returns Box characters */ getBoxChars(style?: BoxStyle): BoxChars; /** * Get color function by name using the ColorAdapter */ private getColorFunction; } /** * Get singleton box formatter instance * * @returns BoxFormatter instance * * @example * import { getBoxFormatter } from './box-formatter.js'; * * const formatter = getBoxFormatter(); * console.log(formatter.formatBox(['Line 1', 'Line 2'])); */ export declare function getBoxFormatter(): BoxFormatter; export {}; //# sourceMappingURL=box-formatter.d.ts.map