@tduyng/prettyoutput
Version:
Library to format JSON objects into a colorful, YAML-style output. Ideal for pretty printing logs with high performance.
31 lines • 844 B
TypeScript
export type Color = 'black' | 'blue' | 'brown' | 'cyan' | 'gray' | 'green' | 'grey' | 'magenta' | 'orange' | 'pink' | 'purple' | 'rainbow' | 'red' | 'reset' | 'white' | 'yellow';
export type InputColor = {
keys?: Color;
dash?: Color;
number?: Color;
string?: Color;
true?: Color;
false?: Color;
null?: Color;
undefined?: Color;
};
export type RenderOptions = {
indentation: string;
indentationLength?: number;
maxDepth: number;
noColor?: boolean;
colors?: InputColor;
alignKeyValues?: boolean;
hideUndefined?: boolean;
};
export type Stack = {
indentation: string;
depth: number;
input: unknown;
noRender?: boolean;
};
export type Formatter = (input: string) => string;
export type Colors = {
[key in Color]: Formatter;
};
//# sourceMappingURL=definitions.d.ts.map