UNPKG

@xec-sh/cli

Version:

Xec: The Universal Shell for TypeScript

50 lines (49 loc) 1.59 kB
export type OutputFormat = 'text' | 'json' | 'yaml' | 'csv'; export interface TableColumn { header: string; width?: number; align?: 'left' | 'center' | 'right'; wrap?: boolean; } export interface TableData { columns: TableColumn[]; rows: string[][]; } export interface Spinner { start(): void; stop(): void; succeed(message?: string): void; fail(message?: string): void; update(message: string): void; } export declare class OutputFormatter { private format; private quiet; private verbose; private colors; setFormat(format: OutputFormat): void; setQuiet(quiet: boolean): void; setVerbose(verbose: boolean): void; setColors(colors: boolean): void; header(title: string): void; success(message: string): void; error(message: string | Error): void; warn(message: string): void; info(message: string): void; debug(message: string): void; output(data: any, title?: string): void; table(data: TableData): void; keyValue(data: Record<string, any>, title?: string): void; list(items: string[], title?: string): void; status(status: 'success' | 'warning' | 'error' | 'info', message: string): void; progress(current: number, total: number, message?: string): void; diff(before: string, after: string, title?: string): void; simpleTable(data: any[], columns?: string[]): void; json(data: any): void; yaml(data: any): void; spinner(message: string): Spinner; private outputText; private outputKeyValue; private outputTable; private outputCsv; }