import type { BufferEncoding, CpOptions, DirectoryEntry, DirentEntry, FileContent, FileEntry, FileSystemSnapshot, FsEntry, FsStat, IFileSystem, InitialFiles, LazyFileEntry, MkdirOptions, ReadFileOptions, RmOptions, SymlinkEntry, WriteFileOptions } from "../interface.js"; export type { BufferEncoding, DirectoryEntry, FileContent, FileEntry, FsEntry, FsStat, IFileSystem, LazyFileEntry, SymlinkEntry, }; export interface FsData { [path: string]: FsEntry; } export declare class InMemoryFs implements IFileSystem { private data; private childIndex; private addToChildIndex; private removeFromChildIndex; private rebuildChildIndex; constructor(initialFiles?: InitialFiles); private checkParentExists; writeFileSync(path: string, content: FileContent, options?: WriteFileOptions | BufferEncoding, metadata?: { mode?: number; mtime?: Date; }): void; /** * Store a lazy file entry whose content is provided by a function on first read. * Writing to the path replaces the lazy entry, so the function is never called. */ writeFileLazy(path: string, lazy: () => string | Uint8Array | Promise, metadata?: { mode?: number; mtime?: Date; }): void; /** * Materialize a lazy file entry, replacing it with a concrete FileEntry. * Returns the materialized FileEntry. */ private materializeLazy; readFile(path: string, options?: ReadFileOptions | BufferEncoding): Promise; readFileBuffer(path: string): Promise; writeFile(path: string, content: FileContent, options?: WriteFileOptions | BufferEncoding): Promise; appendFile(path: string, content: FileContent, options?: WriteFileOptions | BufferEncoding): Promise; exists(path: string): Promise; stat(path: string): Promise; lstat(path: string): Promise; /** * Resolve symlinks in intermediate path components only (not the final component). * Used by lstat which should not follow the final symlink. */ private resolveIntermediateSymlinks; /** * Resolve all symlinks in a path, including intermediate components. * For example: /home/user/linkdir/file.txt where linkdir is a symlink to "subdir" * would resolve to /home/user/subdir/file.txt */ private resolvePathWithSymlinks; mkdir(path: string, options?: MkdirOptions): Promise; /** * Synchronous version of mkdir */ mkdirSync(path: string, options?: MkdirOptions): void; readdir(path: string): Promise; readdirWithFileTypes(path: string): Promise; rm(path: string, options?: RmOptions): Promise; cp(src: string, dest: string, options?: CpOptions): Promise; mv(src: string, dest: string): Promise; getAllPaths(): string[]; resolvePath(base: string, path: string): string; chmod(path: string, mode: number): Promise; symlink(target: string, linkPath: string): Promise; link(existingPath: string, newPath: string): Promise; readlink(path: string): Promise; /** * Resolve all symlinks in a path to get the canonical physical path. * This is equivalent to POSIX realpath(). */ realpath(path: string): Promise; /** * Set access and modification times of a file * @param path - The file path * @param _atime - Access time (ignored, kept for API compatibility) * @param mtime - Modification time */ utimes(path: string, _atime: Date, mtime: Date): Promise; snapshot(): Promise; restore(snapshot: FileSystemSnapshot): Promise; }