import { Readable, Writable } from '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>;
declare class ResourceTracker {
    private reject;
    files: string[];
    streams: (Readable | Writable)[];
    constructor(reject: (err: any) => void);
    addStream(stream: Readable | Writable): void;
    addFile(file: string): void;
}
export declare function withResourceCleanup<T>(fn: (tracker: ResourceTracker) => Promise<T>, onError?: (err: any) => void): Promise<T>;
export {};
//# sourceMappingURL=stream.d.ts.map