import { OutputFormat } from './output-format.js'; export interface JsonFormatterOptions { format: OutputFormat; showTimestamps?: boolean; colorize?: boolean; sortBy?: string; timezone?: string; maxDepth?: number; maxLines?: number; } export interface ProcessStats { recordsProcessed: number; heartbeatsSent: number; errors: number; errorMessages: string[]; startTime: number | null; endTime: number | null; duration?: string; } /** * Generic formatter for any JSON objects (jobs, integrations, datasets, etc.) * Replaces the LogEvent-specific OutputFormatter */ export declare class JsonFormatter { options: JsonFormatterOptions; private tableData; private tableHeaders; private csvHeaders; private csvHeadersPrinted; private csvDroppedFields; private csvDropWarned; constructor(options: JsonFormatterOptions); /** * Reset formatter state */ reset(): void; /** * Fields omitted from streaming CSV output because they were absent from the * header, in first-seen order */ getDroppedCsvFields(): string[]; /** * Format a single object based on selected format */ formatObject(data: Record): string; /** * Format an array of objects */ formatObjects(data: Record[]): string; /** * Add data to table and return empty string (table will be rendered at the end) */ private addToTable; /** * Add data to CSV and return CSV row string (with headers on first call) */ private addToCsv; /** * Track fields a streaming CSV row cannot represent and warn on the first one */ private recordDroppedCsvFields; /** * Flatten nested object into dot notation */ private flattenObject; /** * Format cell value - keep JSON as formatted JSON, primitives as strings * Special handling for timestamp columns to show readable local time */ private formatCellValue; /** * Check if a column name indicates it contains timestamps */ private isTimestampColumn; /** * Format timestamp value to readable time string with timezone support */ private formatTimestamp; /** * Parse a timestamp value for sorting (returns milliseconds since epoch or null) */ private parseTimestamp; /** * Order headers according to common column preferences */ private orderHeaders; /** * Render the accumulated table data */ renderTable(): string; /** * Sort data based on the sortBy option */ private sortData; private flattenRows; private collectColumnNames; /** * Find the actual column name in the data (case-insensitive search) */ private findActualColumnName; /** * Format a CSV row with proper escaping */ private formatCsvRow; /** * Escape a CSV value according to RFC 4180 */ private escapeCsvValue; /** * Format data as a table */ private formatTable; /** * Wrap text to fit column width and pad with spaces */ private wrapAndPad; /** * Wrap text to multiple lines based on column width */ private wrapText; /** * Format JSON with pretty printing and syntax highlighting */ formatPrettyJson(data: Record): string; /** * Format log data based on selected format (alias for formatObject for backwards compatibility) */ formatLogData(data: Record): string; /** * Format job state message */ formatJobState(state: string): string; /** * Format heartbeat status */ formatHeartbeatStatus(action: string, details?: string): string; /** * Format connection status */ formatConnectionStatus(status: string, details?: string): string; /** * Format error messages */ formatError(error: Error, context?: string): string; /** * Format a warning message */ formatWarning(message: string): string; /** * Format summary statistics */ formatSummary(stats: ProcessStats): string; } //# sourceMappingURL=json-formatter.d.ts.map