-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.d.ts
85 lines (68 loc) · 1.66 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
interface WriteOptions {
replacer?: ((key: string, value: any) => any) | (string | number)[];
indent?: number;
writeMethod?: 'safeDump' | 'dump';
columns?: string[];
callback?: (err: Error, dataString: string) => void;
}
type Formatter = (file: string, options: WriteOptions) => string;
interface ParserOptions {
// TODO
}
type Parser = (str: string, options: ParserOptions) => any;
/* --------------------------------------------
* Converters
*/
export function convertDbfToData(
inFileName: string,
outFileName: string,
callback: (err: Error) => void
): void;
export function convertDbfToData(
inFileName: string,
outFileName: string,
options: { makeDirectories: boolean },
callback: (err: Error) => void
): void;
/* --------------------------------------------
* Helpers
*/
export function discernFileFormatter(
fileName: string
): Formatter;
export function discernFormat(
fileName: string
): string;
export function discernParser(
fileName: string,
delimiter?: string
): Parser;
export function exists(
fileName: string,
callback: (err: Error, exists: boolean) => void
): void;
export function existsSync(
fileName: string
): boolean;
export function extMatchesStr(
fileName: string,
extension: string
): boolean;
// export function getParser(
// delimiterOrParser: string | (str: string, parserOptions?: /* TODO */) =>
// ): void;
export function makeDirectories(
outPath: string,
callback: (err: Error) => null
): void;
export function makeDirectoriesSync(
outPath: string
): void;
export function matches(
fileName: string,
matcher: string | RegExp
): boolean;
export function matchesRegExp(
fileName: string,
regex: RegExp
): boolean;