68kcounter
Version:
68000 ASM source code cycle counter
48 lines (47 loc) • 1.32 kB
TypeScript
/**
* Formatter implementations for CLI output
*/
import { Color } from "chalk";
import { Level } from ".";
import { Line } from "./parse";
import { Totals } from "./totals";
export interface IncludedElements {
text: boolean;
timings: boolean;
bytes: boolean;
totals: boolean;
}
export interface Formatter {
format(lines: Line[], totals: Totals): string;
}
export interface JsonOptions {
/** Pretty print JSON with whtespace */
prettyPrint: boolean;
/** Elements to include in output */
include: IncludedElements;
}
export interface PlainTextOptions {
/** Color text output in terminal */
color: boolean;
/** Elements to include in output */
include: IncludedElements;
/** Width of annotation column */
width: number;
}
export declare class JsonFormatter implements Formatter {
private options;
constructor(options: JsonOptions);
format(lines: Line[], totals: Totals): string;
}
export declare class PlainTextFormatter implements Formatter {
private options;
constructor(options: PlainTextOptions);
static levelToColor: Record<Level, typeof Color>;
format(lines: Line[], totals: Totals): string;
private formatTimingColored;
/**
* Display a string with padding
*/
private pad;
private formatNumber;
}