/** * Reads and parses a JSON file. * Throws an error if the file content is not valid JSON. * @param {string} filePath * @returns {Promise} */ export declare function readJsonFileAsync(filePath: string): Promise; /** * Saves an object as JSON to a file. * Automatically creates the directory if it does not exist. * @param {string} filePath * @param {any} data * @param {number} [spaces=2] * @returns {Promise} */ export declare function writeJsonFileAsync(filePath: string, data: any, spaces?: number): Promise; /** * Clears all contents inside a directory but keeps the directory. * @param {string} dirPath */ export declare function clearDirectoryAsync(dirPath: string): Promise; /** * Checks whether a directory is empty. * @param {string} dirPath * @returns {Promise} */ export declare function isDirEmptyAsync(dirPath: string): Promise; /** * Copies a file to a destination. * @param {string} src * @param {string} dest * @param {number} [mode] * @returns {Promise} */ export declare function ensureCopyFileAsync(src: string, dest: string, mode?: number): Promise; /** * Deletes a file (If the file exists). * @param {string} filePath * @returns {Promise} */ export declare function tryDeleteFileAsync(filePath: string): Promise; /** * Writes text to a file (Ensures that the directory exists, creating it recursively if needed). * @param {string} filePath * @param {string} content * @param {import('fs').WriteFileOptions} [ops='utf-8'] * @returns {Promise} */ export declare function writeTextFileAsync(filePath: string, content: string, ops?: import('fs').WriteFileOptions): Promise; /** * Lists all files and dirs in a directory (optionally recursive). * @param {string} dirPath * @param {boolean} [recursive=false] * @returns {Promise<{ files: string[]; dirs: string[] }>} */ export declare function listFilesAsync(dirPath: string, recursive?: boolean): Promise<{ files: string[]; dirs: string[]; }>; /** * Lists all directories in a directory (optionally recursive). * @param {string} dirPath * @param {boolean} [recursive=false] * @returns {Promise} */ export declare function listDirsAsync(dirPath: string, recursive?: boolean): Promise; /** * Returns the size of a file in bytes. * @param {string} filePath * @returns {Promise} */ export declare function fileSizeAsync(filePath: string): Promise; /** * Returns the total size of a directory in bytes. * @param {string} dirPath * @returns {Promise} */ export declare function dirSizeAsync(dirPath: string): Promise; /** * Restores the most recent backup of a file. * @param {string} filePath * @param {string} [ext='bak'] * @returns {Promise} */ export declare function restoreLatestBackupAsync(filePath: string, ext?: string): Promise; /** * Creates a backup copy of a file with .bak timestamp suffix. * @param {string} filePath * @param {string} [ext='bak'] * @returns {Promise} */ export declare function backupFileAsync(filePath: string, ext?: string): Promise; //# sourceMappingURL=asyncFuncs.d.mts.map