import type { Stats } from 'fs'; import { EntryInfo } from '../internal'; /** * Checks if a path exists. * @param filePath Path to check. * @returns True if path exists, false otherwise. */ export declare function pathExists(filePath: string): Promise; /** * Gets fs.Stats for a path. Throws ConduitError if path not found or other access issues. */ export declare function getStats(filePath: string): Promise; /** * Gets fs.Stats for a path using lstat (does not follow symlinks). * Throws ConduitError if path not found or other access issues. */ export declare function getLstats(filePath: string): Promise; /** * Reads a file's content as a UTF-8 string. * @param filePath Path to the file. * @param maxLength Optional max length to read. * @returns File content as string. * @throws ConduitError on failure (e.g., not found, access denied, exceeds limit). */ export declare function readFileAsString(filePath: string, maxLength?: number): Promise; /** * Reads a file's content as a Buffer. * @param filePath Path to the file. * @param maxLength Optional max length to read. * @returns File content as Buffer. * @throws ConduitError on failure. */ export declare function readFileAsBuffer(filePath: string, maxLength?: number): Promise; /** * Writes content to a file. * @param filePath Path to the file. * @param content Content to write (string or Buffer). * @param encoding For string content, the input encoding (text or base64). * @param mode Write mode (overwrite or append). * @returns Number of bytes written. */ export declare function writeFile(filePath: string, content: string | Buffer, encoding?: 'text' | 'base64', mode?: 'overwrite' | 'append'): Promise; /** * Creates a directory. * @param dirPath Path to the directory. * @param recursive If true, create parent directories if they don't exist. */ export declare function createDirectory(dirPath: string, recursive?: boolean): Promise; /** * Deletes a file or directory. * @param itemPath Path to the file or directory. * @param recursive Must be true to delete a non-empty directory. */ export declare function deletePath(itemPath: string, recursive?: boolean): Promise; /** * Lists entries in a directory. * @param dirPath Path to the directory. * @returns Array of entry names (strings). */ export declare function listDirectory(dirPath: string): Promise; /** * Copies a file or directory. * @param sourcePath Source path. * @param destinationPath Destination path. */ export declare function copyPath(sourcePath: string, destinationPath: string): Promise; /** * Moves/renames a file or directory. * @param sourcePath Source path. * @param destinationPath Destination path. */ export declare function movePath(sourcePath: string, destinationPath: string): Promise; /** * Updates file timestamps (like touch command). * @param filePath Path to the file. */ export declare function touchFile(filePath: string): Promise; /** * Populates an EntryInfo object from fs.Stats. * @param fullPath Absolute path to the entry. * @param statsParam fs.Stats object for the entry. * @param name Optional name override (defaults to basename of fullPath). * @returns Populated EntryInfo object. */ export declare function createEntryInfo(fullPath: string, statsParam: Stats, name?: string): Promise>; /** * Calculates the recursive size of a directory. * @param dirPath Path to the directory. * @param currentDepth Current recursion depth. * @param maxDepth Max recursion depth from config. * @param timeoutMs Timeout for the whole operation. * @param startTime Start time of the operation (for timeout tracking). * @returns Object with total size and a potential note if timed out or depth limited. */ export declare function calculateRecursiveDirectorySize(dirPath: string, currentDepth: number, maxDepth: number, timeoutMs: number, startTime: number): Promise<{ size: number; note?: string; }>; export declare function getFilesystemStats(resolvedPath: string): Promise<{ total_bytes: number; free_bytes: number; available_bytes: number; used_bytes: number; }>; /** * Ensures that a directory exists. Creates it recursively if missing. * @param dirPath Directory path to ensure. */ export declare function ensureDirectoryExists(dirPath: string): Promise; //# sourceMappingURL=fileSystemOps.d.ts.map