///
/**
* The generic types idea was based on the MIT licensed project https://github.com/forbesmyester/stronger-typed-streams
* Originally published by Matt Forrester https://github.com/forbesmyester
* Types improved and additional features implemented by Roberto Sebestyen roberto@sebestyen.ca https://github.com/hiro5id
*/
import * as NodeStream from 'stream';
export declare abstract class Writable extends NodeStream.Writable {
'typechecking-field': In | undefined;
/**
* give this stream a name so that we can easily reference it in logs
* a common implementation would be:
* public readonly name: string = MyClass.name;
*/
abstract readonly name: string;
private readonly _baseWrite;
constructor(opts?: {});
/**
* Syntactic sugar to easily add error handlers between pipe stages
* @param func - the error function
*/
err(func: (err: any) => void): Writable;
toPromiseFinish(): Promise;
/**
* This callback gets called when a NULL value comes through the stream indicating the end of the stream
* This optional function will be called before the stream closes, delaying the 'finish' event until callback is called. This is useful to close resources or write buffered data before a stream ends.
*/
_finalEx(callback: (error?: Error | null) => void): void;
_writeEx(chunk: In, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
_write(chunk: In, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
/**
* This callback gets called when a NULL value comes through the stream indicating the end of the stream
* This optional function will be called before the stream closes, delaying the 'finish' event until callback is called. This is useful to close resources or write buffered data before a stream ends.
*/
_final(callback: (error?: Error | null) => void): void;
}