import { Dirent, OpenMode, PathLike, Stats, closeSync, constants, existsSync, mkdirSync, openSync, promises, readFileSync, unlinkSync, utimesSync, watch, writeFileSync } from "node:fs"; import { FileHandle } from "node:fs/promises"; //#region src/fs/index.d.ts interface JsonReadOptions { encoding?: BufferEncoding; throws?: boolean; } interface JsonWriteOptions { encoding?: BufferEncoding; replacer?: ((this: any, key: string, value: any) => any) | Array | null; spaces?: number | string; } interface CopyOptions { dereference?: boolean; errorOnExist?: boolean; filter?: (src: string, dest: string) => boolean | Promise; overwrite?: boolean; preserveTimestamps?: boolean; verbatimSymlinks?: boolean; } interface MoveOptions { overwrite?: boolean; } declare function pathExists(target: string): Promise; declare function pathExistsSync(target: string): boolean; declare function exists(target: string): Promise; declare function ensureDir(dir: string): Promise; declare function ensureFile(file: string): Promise; declare function remove(target: string): Promise; declare function ensureSymlink(target: string, file: string): Promise; declare function emptyDir(dir: string): Promise; declare function outputFile(file: string, data: string | NodeJS.ArrayBufferView, options?: BufferEncoding): Promise; declare function appendFile(file: string, data: string | NodeJS.ArrayBufferView, options?: BufferEncoding): Promise; declare function writeJson(file: string, data: unknown, options?: JsonWriteOptions): Promise; declare function writeJSON(file: string, data: unknown, options?: JsonWriteOptions): Promise; declare function outputJson(file: string, data: unknown, options?: JsonWriteOptions): Promise; declare function outputJSON(file: string, data: unknown, options?: JsonWriteOptions): Promise; declare function readJson(file: string, options?: JsonReadOptions): Promise; declare function readJSON(file: string, options?: JsonReadOptions): Promise; declare function readJsonSync(file: string, options?: JsonReadOptions): T | null; declare function copy(src: string, dest: string, options?: CopyOptions): Promise; declare function move(src: string, dest: string, options?: MoveOptions): Promise; declare function close$1(handle: number | FileHandle): Promise; declare const fs: { Dirent: typeof Dirent; Stats: typeof Stats; access: typeof promises.access; appendFile: typeof appendFile; close: typeof close$1; closeSync: typeof closeSync; constants: typeof constants; copy: typeof copy; emptyDir: typeof emptyDir; ensureDir: typeof ensureDir; ensureFile: typeof ensureFile; ensureSymlink: typeof ensureSymlink; exists: typeof exists; existsSync: typeof existsSync; mkdir: typeof promises.mkdir; mkdirSync: typeof mkdirSync; mkdtemp: typeof promises.mkdtemp; move: typeof move; open: (file: PathLike, flags: OpenMode) => Promise; openSync: typeof openSync; outputFile: typeof outputFile; outputJSON: typeof outputJSON; outputJson: typeof outputJson; pathExists: typeof pathExists; pathExistsSync: typeof pathExistsSync; readFile: typeof promises.readFile; readFileSync: typeof readFileSync; readJSON: typeof readJSON; readJson: typeof readJson; readJsonSync: typeof readJsonSync; readdir: typeof promises.readdir; rm: typeof promises.rm; remove: typeof remove; stat: typeof promises.stat; symlink: typeof promises.symlink; unlinkSync: typeof unlinkSync; utimes: typeof promises.utimes; utimesSync: typeof utimesSync; watch: typeof watch; writeFile: typeof promises.writeFile; writeFileSync: typeof writeFileSync; writeJSON: typeof writeJSON; writeJson: typeof writeJson; }; type FsDirent = Dirent; type FsStats = Stats; //#endregion export { CopyOptions, FsDirent, FsStats, JsonReadOptions, JsonWriteOptions, MoveOptions, fs };