import { ErrorInterface, SuccessInterface } from "../../config/Interfaces/Helper/response.helper.interface"; export default class FileManager { private readonly responseHelper; private readonly WorkerProcess; constructor(); WriteFile(path: string, data: string): Promise; /** * Writes a file and fsyncs it before returning, so the write is guaranteed on disk * (not just sitting in the OS page cache) once this resolves. Use for anything a * crash-recovery path depends on finding - e.g. transaction registry state - where * a plain `WriteFile` can silently vanish on power loss even though the call succeeded. */ WriteFileDurable(path: string, data: string): Promise; /** Atomically creates a file only if absent (OS-level 'wx' flag) - safe for lock files. */ WriteFileExclusive(path: string, data: string): Promise; ReadFile(path: string): Promise; DeleteFile(path: string): Promise; FileExists(path: string): Promise; CreateFile(path: string): Promise; MoveFile(oldPath: string, newPath: string): Promise; /** * Retrieves the size of a file in bytes. * * @param path - The path to the file. * @returns A promise that resolves to a SuccessInterface containing the file size in bytes, * or an ErrorInterface if an error occurs. */ GetFileSize(path: string): Promise; DeleteFileWithLock(collectionPath: string, fileName: string): Promise; }