UNPKG

1.37 kBTypeScriptView Raw
1/**
2 * Defines prettyjson version
3 */
4export declare var version: string;
5
6/**
7 * Render pretty json.
8 *
9 * @param data {any} Data to prettify.
10 * @param options {IOptions} Hash with different options to configure the renderer.
11 * @param indentation {number} Indentation size.
12 *
13 * @return {string} pretty serialized json data ready to display.
14 */
15export declare function render(data: any, options?: RendererOptions, indentation?: number): string;
16
17/**
18 * Render pretty json from a string.
19 *
20 * @param data {string} Serialized JSON data to prettify.
21 * @param options {IOptions} Hash with different options to configure the renderer.
22 * @param indentation {number} Indentation size.
23 *
24 * @return {string} pretty serialized json data ready to display.
25 */
26export declare function renderString(data: string, options?: RendererOptions, indentation?: number): string;
27
28export interface RendererOptions {
29 /**
30 * Define behavior for Array objects
31 */
32 emptyArrayMsg?: string | undefined; // default: (empty)
33 inlineArrays?: boolean | undefined;
34 noAlign?: boolean | undefined;
35
36 /**
37 * Color definition
38 */
39 noColor?: boolean | undefined;
40 keysColor?: string | undefined;
41 dashColor?: string | undefined;
42 numberColor?: string | undefined;
43 stringColor?: string | undefined;
44
45 defaultIndentation?: number | undefined;
46}