-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
50 lines (44 loc) · 1.15 KB
/
types.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
export type TSource =
| string
| string[]
| Promise<string[]>
| (() => string[] | Promise<string[]>);
export type TDestination = string | { from?: string; to: string };
export type TCopyFilterFn =
| ((src: string, dest: string) => boolean)
| ((src: string, dest: string) => Promise<boolean>);
export type TContentFn = (
file: string,
raw?: string
) => string | void | Promise<string | void>;
/**
* Options taken by read *fs* functions.
*/
export interface IFsReadOptions {
/**
* Whether to enable logging. Default: `true`.
*/
logger?: boolean;
/**
* If `false`, it won't fail if a path doesn't exist for a read, or if it already exists for a write. Default: `false`.
*/
fail?: boolean;
}
/**
* Options taken by *fs* functions.
*/
export interface IFsCreateDeleteOptions extends IFsReadOptions {
/**
* If `true`, it will require user confirmation for removal. Default: `false`.
*/
confirm?: boolean;
}
/**
* Options taken by *fs* write functions.
*/
export interface IFsUpdateOptions extends IFsCreateDeleteOptions {
/**
* Overwrites files if they already exist. Default: `true`.
*/
overwrite?: boolean;
}