-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
index.d.ts
98 lines (84 loc) · 2.31 KB
/
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
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
declare module 'convert-csv-to-json' {
export class ConvertCsvToJson {
/**
* Prints a digit as Number type (for example 32 instead of '32')
*/
formatValueByType(active: boolean): this;
/**
*
*/
supportQuotedField(active: boolean): this;
/**
* Defines the field delimiter which will be used to split the fields
*/
fieldDelimiter(delimiter: string): this;
/**
* Defines the index where the header is defined
*/
indexHeader(index: number): this;
/**
* Defines how to match and parse a sub array
*/
parseSubArray(delimiter: string, separator: string): this;
/**
* Defines a custom encoding to decode a file
*/
customEncoding(encoding: string): this;
/**
* Defines a custom encoding to decode a file
*/
utf8Encoding(): this;
/**
* Defines ucs2 encoding to decode a file
*/
ucs2Encoding(): this;
/**
* Defines utf16le encoding to decode a file
*/
utf16leEncoding(): this;
/**
* Defines latin1 encoding to decode a file
*/
latin1Encoding(): this;
/**
* Defines ascii encoding to decode a file
*/
asciiEncoding(): this;
/**
* Defines base64 encoding to decode a file
*/
base64Encoding(): this;
/**
* Defines hex encoding to decode a file
*/
hexEncoding(): this;
/**
* Parses .csv file and put its content into a file in json format.
* @param {inputFileName} path/filename
* @param {outputFileName} path/filename
*
*/
generateJsonFileFromCsv(
inputFileName: string,
outputFileName: string,
): void;
/**
* Parses .csv file and put its content into an Array of Object in json format.
* @param {inputFileName} path/filename
* @return {Array} Array of Object in json format
*
*/
getJsonFromCsv(inputFileName: string): any[];
csvStringToJson(csvString: string): any[];
/**
* Parses .csv file and put its content into a file in json format.
* @param {inputFileName} path/filename
* @param {outputFileName} path/filename
*
* @deprecated Use generateJsonFileFromCsv()
*/
jsonToCsv(inputFileName: string, outputFileName: string): void;
}
const converter: ConvertCsvToJson;
export default converter;
}