This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
60 lines (54 loc) · 1.97 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
declare module 'gulp-i18n-json-tools' {
/**
* @param baseJson json used as a template which keys can be overriden
* @param overrideJson json which overrides keys of originalFile
* @param outputFileName name of output merged file
*/
const jsonMerger: (baseJson: object, overrideJson: object, outputFileName: string) => NodeJS.ReadStream;
/**
* @param json json to flat as a csv file
* @param outputFileName name of output csv file
* @param options (optional) advanced options of csv and flattening json. See JsonToCsvOptions type for details
*/
const jsonToCsv: (json: object, outputFileName: string, options?: SerializationOptions) => NodeJS.ReadStream;
/**
* @param targetJson json to be updated with matched keys
* @param importCsv content of csv to import
* @param outputFileName name of output updated json
* @param options (optional) advanced options of csv and flattening json. See JsonToCsvOptions type for details
*/
const updateJsonFromCsv: (targetJson: object, importCsv: string, outputFileName: string, options?: SerializationOptions) => NodeJS.ReadStream;
export = {
jsonMerger,
jsonToCsv,
updateJsonFromCsv
};
type SerializationOptions = {
json?: JsonSerializationOptions,
csv?: CsvSerializationOptions
};
type JsonSerializationOptions = {
/**
* Json property separator (ex: {A: { B: 'hello' } } => "A.B": "hello")
* @default '.'
*/
keySeparator: string,
/**
* When serializing arrays, add a special mark on the index (ex: { A: ['hello'] } => "A.$0": "hello")
* @default '$'
*/
arrayIndexMark: string
};
type CsvSerializationOptions = {
/**
* CSV separator
* @default ','
*/
separator: string,
/**
* Line break symbol
* @default '\r\n'
*/
lineBreak: string
};
}