import type { StorageProvider, StorageStats } from './storage-provider.js'; /** * FSStorageProvider — Node.js `fs` implementation of StorageProvider. * * - ENOENT reads return `undefined` (no throw). * - Writes create parent directories recursively. * - Appends create the file (and parent dirs) if missing. * - delete is a no-op when the file does not exist. * - list returns an empty array for a missing directory. * - Optional `rootDir` confines all operations to a specific directory tree. */ export declare class FSStorageProvider implements StorageProvider { private static readonly CASE_INSENSITIVE; private readonly rootDir?; constructor(rootDir?: string); private pathStartsWith; private pathEquals; /** * Validates that filePath resolves within rootDir and does not escape * via path traversal or symlinks. * * ⚠️ TOCTOU: This is a user-space check. Between validation and the * subsequent fs operation, a path component could theoretically be * swapped for a symlink. This is an inherent limitation of user-space * path validation on POSIX systems. For defense-in-depth, callers * operating in hostile environments should use OS-level confinement * (chroot, namespaces, or sandboxing) in addition to this check. */ private assertSafePath; private assertSafePathSync; read(filePath: string): Promise; write(filePath: string, data: string): Promise; append(filePath: string, data: string): Promise; exists(filePath: string): Promise; list(dirPath: string): Promise; delete(filePath: string): Promise; readSync(filePath: string): string | undefined; writeSync(filePath: string, data: string): void; existsSync(filePath: string): boolean; listSync(dirPath: string): string[]; deleteDir(dirPath: string): Promise; isDirectory(targetPath: string): Promise; mkdir(dirPath: string, options?: { recursive?: boolean; }): Promise; rename(oldPath: string, newPath: string): Promise; copy(srcPath: string, destPath: string): Promise; stat(targetPath: string): Promise; isDirectorySync(targetPath: string): boolean; mkdirSync(dirPath: string, options?: { recursive?: boolean; }): void; statSync(targetPath: string): StorageStats | undefined; appendSync(filePath: string, data: string): void; deleteSync(filePath: string): void; renameSync(oldPath: string, newPath: string): void; copySync(srcPath: string, destPath: string): void; deleteDirSync(dirPath: string): void; } //# sourceMappingURL=fs-storage-provider.d.ts.map