//#region src/writeFileIfChanged.d.ts /** * Options for {@link writeFileIfChanged}. */ export type WriteFileIfChangedOptions = { /** Encoding used to turn `data` into bytes. Defaults to `'utf8'`. */ encoding?: BufferEncoding; /** Directory to hold the temporary file used for the atomic swap. */ tempDir?: string; /** * Write atomically via a temp file + `rename` so readers never observe a * half-written file. This creates a fresh inode on every write, which roughly * doubles the cost of a changed write compared to overwriting in place. Set to * `false` for callers whose consumers tolerate torn reads to write directly. * Defaults to `true`. */ atomic?: boolean; }; /** * Write `data` to `path` only when it differs from the file already on disk, * preserving the existing file's permission mode. * * The whole file is read back and byte-compared because the files written here * (dictionaries, entry points, types) are small, so reading beats streaming a * hash. When the content is unchanged the write is skipped entirely, which both * avoids inode churn and prevents downstream watchers from rebuilding. * * @returns `true` when the file was written, `false` when it was already up to date. */ export declare const writeFileIfChanged: (path: string, data: string, { encoding, tempDir, atomic }?: WriteFileIfChangedOptions) => Promise; //#endregion //# sourceMappingURL=writeFileIfChanged.d.ts.map