Skip to content

Commit 8a40c67

Browse files
author
Malte Legenhausen
committed
Typescript definition file fixed
1 parent 19f5aa5 commit 8a40c67

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

index.d.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1-
declare module 'json2csv' {
2-
interface CSVCallback {
3-
(error: Error, csv: string): void;
1+
declare namespace json2csv {
2+
interface IField {
3+
label?: string;
4+
value: string;
5+
default?: string;
6+
}
7+
8+
interface IOptions {
9+
data: any[];
10+
fields?: (string | IField)[];
11+
filedNames?: string[];
12+
del?: string;
13+
defaultValue?: string;
14+
quotes?: string;
15+
doubleQuotes?: string;
16+
hasCSVColumnTitle?: boolean;
17+
eol?: string;
18+
newLine?: string;
19+
flatten?: boolean;
20+
excelStrings?: boolean;
421
}
522

6-
function json2csv(options: any, callback: CSVCallback): string;
7-
export = json2csv;
23+
interface ICallback {
24+
(error: Error, csv: string): void;
25+
}
26+
27+
export function json2csv(options: IOptions, callback: ICallback): string;
828
}
29+
30+
export = json2csv.json2csv;

0 commit comments

Comments
 (0)