export declare const getEasyFs: import("@gaubee/util").FuncRemember<() => Promise<{ writeFile: (filePath: string, data: FileSystemWriteChunkType, opts?: { append?: boolean; }) => Promise; createWriteStream: (filePath: string) => Promise; readFileText: (filePath: string) => Promise; readFileBinary: (filePath: string) => Promise>; createReadStream: (filePath: string) => Promise>>; readdir: (dirPath: string) => Promise; mkdir: (dirPath: string, opts?: { recursive?: boolean; }) => Promise; exists: (path: string) => Promise; stat: (path: string) => Promise<{ readonly isFile: true; readonly size: number; readonly lastModified: number; } | { readonly isFile: false; readonly size?: undefined; readonly lastModified?: undefined; }>; rm: (path: string, opts?: { recursive?: boolean; }) => Promise; }>, () => Promise | undefined>; export type EasyFS = Awaited>; /** `null` 代表文件不存在 */ export type Snapshot = { mtime: number; size: number; } | null; export type FileChangeEvent = { event: "init" | "add" | "modify" | "delete"; newSnap: Snapshot; }; /** * 创建一个一次性的、有状态的文件变更监听器。 * 它会异步地等待,直到文件的状态发生变化,然后解析并结束。 * 它返回一个包含 promise 和 dispose 函数的对象,用于手动取消。 * * @param filePath 要监听的文件路径。 * @param currentSnap 文件的当前快照。`null` 表示文件当前不存在。 * @param options 配置项。 * @returns 一个包含 promise 和 dispose 方法的对象。 */ export declare function whenFileChanged(filePath: string, currentSnap: Snapshot, options?: { strategy?: "stat"; interval?: number; initEvent?: boolean; }): { promise: Promise; dispose(): void; }; //# sourceMappingURL=easy_fs.d.ts.map