@tduyng/prettyoutput
Version:
Library to format JSON objects into a colorful, YAML-style output. Ideal for pretty printing logs with high performance.
39 lines • 2.08 kB
TypeScript
import type { Color, InputColor, RenderOptions } from './definitions.js';
/**
* Get color of an input
* @param {*} input
* @param {InputColor} color
* @return {string|undefined} - color or undefined if no color
*/
export declare const getColor: (input: unknown, color?: InputColor) => Color | undefined;
export declare const indentString: (input: string, options: RenderOptions) => string;
/**
* Handling serialization of different input types.
*/
export declare const renderSerializable: (input: unknown, options: RenderOptions, indentation: string) => string;
export declare const renderMultilineString: (input: string, options: RenderOptions, indentation: string) => string;
export declare const renderDash: (options: RenderOptions, indentation: string) => string;
export declare const renderMaxDepth: (indentation: string) => string;
export declare const renderObjectKey: (key: string, options: RenderOptions, indentation: string) => string;
/**
* Renders the value in a key-value pair for serializable objects.
*/
export declare const renderSerializableObjectValue: (key: string, value: unknown, valueColumn: number, options: RenderOptions, indentation: string) => string | undefined;
/**
* Handles rendering when max depth is reached for objects.
*/
export declare const renderMaxDepthObjectValue: (key: string, valueColumn: number, options: RenderOptions, indentation: string) => string;
export declare const renderSerializableArrayValue: (value: string, options: RenderOptions, indentation: string) => string;
/**
* Handles rendering when max depth is reached for arrays.
*/
export declare const renderMaxDepthArrayValue: (options: RenderOptions, indentation: string) => string;
/**
* Renders error stack trace.
*/
export declare const renderErrorStack: (stack: string, options: RenderOptions, indentation: string) => string;
/**
* Renders object key and stack trace for error objects.
*/
export declare const renderObjectErrorStack: (key: string, stack: string, options: RenderOptions, indentation: string) => string;
//# sourceMappingURL=renderer.d.ts.map