export interface FileStat {
    size: number;
    mtimeMs: number;
    isDirectory: boolean;
    isFile: boolean;
}
export interface DirEntry {
    name: string;
    isDirectory: boolean;
    isFile: boolean;
}
export interface FileSystem {
    exists(path: string): boolean;
    stat(path: string): FileStat | null;
    readFile(path: string): string;
    /** 原子写 —— 先写 .tmp 再 rename，避免 reader 看到半截内容 */
    writeFileAtomic(path: string, content: string): void;
    /** 非原子写，少数场景用（如 append log） */
    writeFile(path: string, content: string): void;
    readDir(path: string): DirEntry[];
    mkdir(path: string, opts?: {
        recursive?: boolean;
    }): void;
    unlink(path: string): void;
    /** 递归删除目录或文件 */
    rm(path: string, opts?: {
        recursive?: boolean;
        force?: boolean;
    }): void;
    rename(from: string, to: string): void;
}
export declare class NodeFileSystem implements FileSystem {
    exists(path: string): boolean;
    stat(path: string): FileStat | null;
    readFile(path: string): string;
    writeFileAtomic(path: string, content: string): void;
    writeFile(path: string, content: string): void;
    readDir(path: string): DirEntry[];
    mkdir(path: string, opts?: {
        recursive?: boolean;
    }): void;
    unlink(path: string): void;
    rm(path: string, opts?: {
        recursive?: boolean;
        force?: boolean;
    }): void;
    rename(from: string, to: string): void;
}
/**
 * 简版内存 FS —— 支持 absolute path 的读写/扫描/删除。
 * 用于 Service 层单测：构造场景快、清理干净、不依赖 tmp 目录。
 * 不追求和 POSIX 100% 语义一致，够测试用即可。
 */
export declare class InMemoryFileSystem implements FileSystem {
    private root;
    private counter;
    private readonly nowFn;
    /**
     * @param opts.nowFn 自定义"写入时的 mtime 生成器"。默认用 Date.now()（和 Node FS 语义一致）。
     *                   测试想要精确控制 mtime 可以传 FakeClock 的 now 方法。
     */
    constructor(opts?: {
        nowFn?: () => number;
    });
    private tick;
    private walk;
    /**
     * 找到 path 的父目录节点 + basename；父不存在时按 createDirs 决定是否补齐。
     * 返回 null 仅当 path 为空。
     */
    private walkParent;
    exists(path: string): boolean;
    stat(path: string): FileStat | null;
    readFile(path: string): string;
    writeFileAtomic(path: string, content: string): void;
    writeFile(path: string, content: string): void;
    readDir(path: string): DirEntry[];
    mkdir(path: string, opts?: {
        recursive?: boolean;
    }): void;
    unlink(path: string): void;
    rm(path: string, opts?: {
        recursive?: boolean;
        force?: boolean;
    }): void;
    rename(from: string, to: string): void;
    private writeEntryAt;
}
//# sourceMappingURL=filesystem.d.ts.map