1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export * from "mz/fs";
|
9 | export * from "fs-extra";
|
10 |
|
11 | export interface WriteOptions {
|
12 | encoding?: string;
|
13 | mode?: number;
|
14 | flag?: string;
|
15 | }
|
16 |
|
17 | type JsonReplacerArray = Array<number | string>;
|
18 |
|
19 | type JsonReplacerFunction = (key: string, value: any) => any;
|
20 |
|
21 | type JsonReplacer = JsonReplacerArray | JsonReplacerFunction;
|
22 |
|
23 | export interface WriteJsonOptions extends WriteOptions {
|
24 | spaces?: number;
|
25 | replacer?: JsonReplacer;
|
26 | }
|
27 |
|
28 | export interface ReadJsonOptions {
|
29 | encoding: string;
|
30 | flag?: string;
|
31 | reviver: (key: any, value: any) => any;
|
32 | }
|
33 |
|
34 | export function copy(src: string, dst: string): Promise<void>;
|
35 | export function emptyDir(dir: string): Promise<void>;
|
36 | export function ensureFile(file: string): Promise<void>;
|
37 | export function ensureDir(dir: string): Promise<void>;
|
38 | export function ensureLink(srcpath: string, dstpath: string): Promise<void>;
|
39 | export function ensureSymlink(srcpath: string, dstpath: string, type?: "dir" | "file" | "junction"): Promise<void>;
|
40 | export function mkdirs(dir: string): Promise<void>;
|
41 | export function move(src: string, dst: string): Promise<void>;
|
42 | export function outputFile(file: string, data: string | Buffer, options?: WriteOptions): Promise<void>;
|
43 | export function outputJson(file: string, data: any, options?: WriteJsonOptions): Promise<void>;
|
44 | export function readJson(file: string, options?: ReadJsonOptions): Promise<any>;
|
45 | export function remove(path: string): Promise<void>;
|
46 | export function writeJson(file: string, data: any, options?: WriteJsonOptions): Promise<void>;
|
47 |
|
48 |
|
49 | export {
|
50 | emptyDir as emptydir,
|
51 | ensureFile as createFile,
|
52 | ensureLink as createLink,
|
53 | ensureSymlink as createSymlink,
|
54 | mkdirs as mkdirp,
|
55 | outputJson as outputJSON,
|
56 | readJson as readJSON,
|
57 | writeJson as writeJSON
|
58 | };
|