-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.d.ts
27 lines (24 loc) · 833 Bytes
/
index.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
interface FormatOptions {
indent?: number; // Integer, Large then 0, default: 2
expand?: boolean; // Default: true
strict?: boolean; // Default: false
escape?: boolean; // Default: false
unscape?: boolean; // Default: false
keyQtMark?: "'" | '"' | ''; // Default: "\""
valQtMark?: "'" | '"'; // Default: "\""
}
interface FormatResult {
result: string;
fmtType: 'info' | 'success' | 'warning' | 'danger';
fmtSign: 'ost' | 'col' | 'val' | 'end' | 'war' | 'scc' | 'err';
fmtLines: number;
fmtTime: number;
message: string;
errFormat: boolean;
errIndex: number;
errNear: string;
errExpect: string;
}
declare function fmt2json(source: string, options?: FormatOptions): string;
declare function fmt2json(source: string, options: FormatOptions & { withDetails: true }): FormatResult;
export = fmt2json;