import { type WriteStream } from "node:fs"; /** * Create a WriteStream whose "error" event is always handled. * * Best-effort artifact writes (full-output temp files, overflow spills) must never * crash the host process: an fs.WriteStream "error" event with no listener becomes * an uncaught exception. Errors are reported through the optional callback instead. */ export declare function createSafeWriteStream(path: string, onError?: (error: Error) => void): WriteStream; /** * End a write stream and resolve only once its buffered data has been flushed and the file closed, so * a subsequent read of the path sees the COMPLETE content. `stream.end()` alone is fire-and-forget: * the flush runs asynchronously, so returning a temp-file path right after `.end()` lets a fast reader * observe a partial (or empty) file. Resolves (never rejects) on "error" too — best-effort artifact * writes must not hang or crash the caller; the caller drops the artifact on error separately. */ export declare function endWriteStream(stream: WriteStream): Promise; //# sourceMappingURL=safe-write-stream.d.ts.map