///
import _fs from 'fs';
export interface WriteOptions {
encoding?: BufferEncoding;
mode?: string | number | undefined;
flag?: string | undefined;
}
declare function copy(src: string, dist: string, opts?: {
/** return true will skip */
skip?: (file: string, stat: _fs.Stats) => Promise | boolean | void;
/** overwrite if exists, default is true */
overwrite?: boolean;
}): Promise;
export declare type WatchDirHandler = (event: string, filename: string) => void;
export declare type WatchDirOptions = {
persistent?: boolean;
/** ms, default 300 */
threshold?: number;
};
declare function watchDir(dir: string, cb: WatchDirHandler): void;
declare function watchDir(dir: string, options: WatchDirOptions, cb: WatchDirHandler): void;
export declare const fs: typeof _fs & typeof _fs.promises & {
watchDir: typeof watchDir;
copy: typeof copy;
exists(path: _fs.PathLike): Promise;
/** exists via lstat, if a symbolic link's target file doesn't exists, `fs.exists` will return false, but `fs.lexists` will return true. */
lexists(path: _fs.PathLike): Promise;
isFile(path: _fs.PathLike): Promise;
isDirectory(path: _fs.PathLike): Promise;
isSymbolicLink(path: _fs.PathLike): Promise;
copyFile: typeof _fs.copyFile.__promisify__ | ((src: _fs.PathLike, dist: _fs.PathLike) => Promise);
/**
* Make directory with parents, like `mkdir -p`
* @param dir
*/
mkdirp(dir: string): Promise;
/**
* Make directory with parents, like `mkdir -p`
* @param dir
*/
mkdirpSync(dir: string): void;
/**
* Remove file or directory recursively, like `rm -rf`
* @param path The path to remove
* @param opts Options
*/
rmrf(path: string): Promise;
outputFile(path: string, data: any, options?: WriteOptions | undefined): Promise;
outputFileSync(path: string, data: any, options?: WriteOptions | undefined): void;
outputJson(path: string, data: object, options?: ({
space?: number | undefined;
replacer?: ((key: string, value: any) => any) | undefined;
} & WriteOptions) | undefined): Promise;
outputJsonSync(path: string, data: any, options?: ({
space?: number | undefined;
replacer?: ((key: string, value: any) => any) | undefined;
} & WriteOptions) | undefined): void;
readJson(path: string, options?: {
encoding?: null | undefined;
flag?: string | undefined;
} | null | undefined): Promise;
readJsonSync(path: string, options?: {
encoding?: null | undefined;
flag?: string | undefined;
} | null | undefined): T_1;
iter(dir: string, skip: (path: string, stat: _fs.Stats) => Promise | boolean | void): Promise;
};
export {};