forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprettyjson.d.ts
55 lines (46 loc) · 1.5 KB
/
prettyjson.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Type definitions for prettyjson
// Project: https://github.com/rafeca/prettyjson
// Definitions by: Wael BEN ZID EL GUEBSI <https://github.com/benzid-wael/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "prettyjson" {
/**
* Defines prettyjson version
*/
export var version: string;
/**
* Render pretty json.
*
* @param data {any} Data to prettify.
* @param options {IOptions} Hash with different options to configure the renderer.
* @param indentation {number} Indentation size.
*
* @return {string} pretty serialized json data ready to display.
*/
export function render(data: any, options?: RendererOptions, indentation?: number): string;
/**
* Render pretty json from a string.
*
* @param data {string} Serialized JSON data to prettify.
* @param options {IOptions} Hash with different options to configure the renderer.
* @param indentation {number} Indentation size.
*
* @return {string} pretty serialized json data ready to display.
*/
export function renderString(data: string, options?: RendererOptions, indentation?: number): string;
export interface RendererOptions {
/**
* Define behavior for Array objects
*/
emptyArrayMsg ?: string; // default: (empty)
inlineArrays ?: boolean;
/**
* Color definition
*/
noColor ?: boolean;
keysColor ?: string;
dashColor ?: string;
numberColor ?: string;
stringColor ?: string;
defaultIndentation ?: number;
}
}