import { Readable, Writable } from 'node:stream';
export declare class PipeError extends Error {
    readonly cause: Error;
    readonly side: 'input' | 'output';
    constructor(cause: Error, side: 'input' | 'output');
}
export declare function safePipe(input: Readable, output: Writable): Promise<void>;
export declare class ResourceTracker {
    readonly files: string[];
    readonly streams: Array<Readable | Writable>;
    private failure;
    addStream(stream: Readable | Writable): void;
    addFile(file: string): void;
    getFailure(): unknown;
    cleanup(): Promise<void>;
}
export declare function withResourceCleanup<T>(fn: (tracker: ResourceTracker) => Promise<T>, onError?: (error: unknown) => void): Promise<T>;
//# sourceMappingURL=stream.d.ts.map