takin
Version:
Front end engineering base toolchain and scaffold
39 lines (38 loc) • 1.32 kB
TypeScript
import { Color, Modifiers } from 'chalk';
declare type SupportColorsOrModifiers = typeof Color | typeof Modifiers;
export declare type CliTableOptions = Partial<{
chars: Partial<Record<'top' | 'top-mid' | 'top-left' | 'top-right' | 'bottom' | 'bottom-mid' | 'bottom-left' | 'bottom-right' | 'left' | 'left-mid' | 'mid' | 'mid-mid' | 'right' | 'right-mid' | 'middle', string>>;
truncate: string;
colors: boolean;
colWidths: number[];
colAligns: Array<'left' | 'middle' | 'right'>;
style: Partial<{
'padding-left': number;
'padding-right': number;
head: SupportColorsOrModifiers[];
border: SupportColorsOrModifiers[];
compact: boolean;
}>;
head: string[];
rows: string[][];
}>;
/**
* 用于生成终端表格
*/
export declare class ConsoleCliTable extends Array {
private options;
constructor(options?: CliTableOptions);
private mergeOptions;
get width(): number;
/**
* For consideration of terminal "color" programs like colors.js,
* which can add ANSI escape color codes to strings,
* we destyle the ANSI color escape codes for padding calculations.
*
* see: http://en.wikipedia.org/wiki/ANSI_escape_code
*/
private strlen;
render(): string;
toString(): string;
}
export {};