Add _destroy to for node Readable stream (#20068)

From the docs:
https://nodejs.org/api/stream.html#stream_readable_destroy_err_callback

As specified in
https://nodejs.org/api/stream.html#stream_readable_destroy_error
implementors are recommended to implement this method instead of
`destroy()` and the original method should be available for calling via
`super`.

This change matches the signatures of other Stream subclasses by
annotating `callback` as `Function` instead of `(err: Error) => void`.
This commit is contained in:
Sami Kukkonen
2017-10-16 20:13:28 +03:00
committed by Andy
parent 7f5638cf95
commit b0447ecb51

View File

@@ -5073,6 +5073,7 @@ declare module "stream" {
unshift(chunk: any): void;
wrap(oldStream: NodeJS.ReadableStream): Readable;
push(chunk: any, encoding?: string): boolean;
_destroy(err: Error, callback: Function): void;
destroy(error?: Error): void;
/**