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 type WatchDirHandler = _fs.WatchListener; export type WatchDirOptions = { persistent?: boolean; /** ms, default 300 */ threshold?: number; /** using iter on linux, default false */ iterOnLinux?: boolean; }; declare function watchDir(dir: string, cb: WatchDirHandler): _fs.FSWatcher | _fs.FSWatcher[]; declare function watchDir(dir: string, options: WatchDirOptions, cb: WatchDirHandler): _fs.FSWatcher | _fs.FSWatcher[]; 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: ((src: _fs.PathLike, dist: _fs.PathLike) => Promise) | typeof _fs.copyFile.__promisify__; /** * 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): Promise; outputFileSync(path: string, data: any, options?: WriteOptions): void; outputJson(path: string, data: object, options?: { space?: number; replacer?: (key: string, value: any) => any; } & WriteOptions): Promise; outputJsonSync(path: string, data: any, options?: { space?: number; replacer?: (key: string, value: any) => any; } & WriteOptions): void; readJson(path: string, options?: { encoding?: null; flag?: string; } | null): Promise; readJsonSync(path: string, options?: { encoding?: null; flag?: string; } | null): T; iter(dir: string, skip: (path: string, stat: _fs.Stats) => Promise | boolean | void): Promise; }; export {};