/** * Header Formatter Service * * Centralized service for creating consistent, formatted headers throughout the CLI. * Follows dependency injection pattern and separation of concerns. * * Provides: * - Box-drawing headers with customizable width and styling * - Single or multi-line headers (title, subtitle, etc.) * - Consistent padding and alignment * - Color theming support */ import { type Color } from './color-adapter.interface.js'; /** * Color options for header styling * Re-export from ColorAdapter for backward compatibility */ export type HeaderColor = Color; /** * Options for header formatting */ export interface HeaderOptions { /** * Primary color for box borders and title * @default 'cyan' */ color?: HeaderColor; /** * Maximum width of the header box * If not specified, auto-calculates based on content * @default auto-calculated from content */ width?: number; /** * Minimum width of the header box * @default 40 */ minWidth?: number; /** * Maximum width of the header box * @default 70 */ maxWidth?: number; /** * Padding on each side of content * @default 4 */ padding?: number; /** * Whether to make the title bold * @default true */ bold?: boolean; /** * Whether to center-align text * @default true */ centered?: boolean; } /** * Header Formatter Service * * Provides consistent header formatting across the CLI application. */ export declare class HeaderFormatter { private readonly defaultOptions; /** * Format a simple header with a single title * * @param title - The main header text * @param options - Formatting options * @returns Formatted header string ready for console output * * @example * const header = formatter.formatHeader('My App'); * console.log(header); * // ╔════════════════╗ * // ║ My App ║ * // ╚════════════════╝ */ formatHeader(title: string, options?: HeaderOptions): string; /** * Format a header with multiple lines of text * * @param lines - Array of text lines to display * @param options - Formatting options * @returns Formatted header string ready for console output * * @example * const header = formatter.formatMultiLineHeader(['Title', 'Line 2', 'Line 3']); * console.log(header); */ formatMultiLineHeader(lines: string[], options?: HeaderOptions): string; /** * Format a simple separator line * * @param width - Width of the separator * @param options - Formatting options * @returns Formatted separator string */ formatSeparator(width?: number, options?: Pick): string; /** * Display a header directly to console * * @param title - The main header text * @param options - Formatting options */ displayHeader(title: string, options?: HeaderOptions): void; /** * Wrap text to fit within a maximum width */ private wrapText; /** * Build a header box with styled content lines * Core method that handles box-drawing logic for all header types * * @param styledLines - Array of lines with their styling functions * @param opts - Merged header options * @returns Formatted header string */ private buildHeaderBox; /** * Center-align text within a given width */ private centerText; /** * Left-align text with padding */ private leftAlignText; /** * Get color function by name using the ColorAdapter */ private getColorFunction; } /** * Get singleton header formatter instance * * @returns HeaderFormatter instance * * @example * import { getHeaderFormatter } from './header-formatter.js'; * * const formatter = getHeaderFormatter(); * console.log(formatter.formatHeader('My Title')); */ export declare function getHeaderFormatter(): HeaderFormatter; //# sourceMappingURL=header-formatter.d.ts.map