Skip to content

Commit

Permalink
[PR] Add destroy method to streams
Browse files Browse the repository at this point in the history
Summary:
Fixes #3204.
Pull Request resolved: #5988

Reviewed By: jbrown215

Differential Revision: D13871521

Pulled By: nmote

fbshipit-source-id: 5fd0f28a6b527681b662de66bde3a4efc681688b
  • Loading branch information
Hiroyuki Ikezoe authored and facebook-github-bot committed Feb 5, 2019
1 parent 5ef67eb commit 306096a
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 126 deletions.
4 changes: 2 additions & 2 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,6 @@ declare class http$Agent<SocketT = net$Socket> {
}

declare class http$IncomingMessage<SocketT = net$Socket> extends stream$Readable {
destroy(error?: Error): void;
headers: Object;
rawHeaders: Array<string>;
httpVersion: string;
Expand Down Expand Up @@ -1414,7 +1413,6 @@ declare class net$Socket extends stream$Duplex {
bytesRead: number;
bytesWritten: number;
connect(options: Object, connectListener?: Function): void;
destroy(exception?: Error): void;
destroyed: boolean;
end(
chunk?: string | Buffer,
Expand Down Expand Up @@ -1673,6 +1671,7 @@ declare class stream$Readable extends stream$Stream {
unshift(chunk: Buffer | string): void;
push(chunk: ?(Buffer | string), encoding? : string): boolean;
wrap(oldReadable: any): stream$Readable;
destroy(error?: Error): this;
}

type writableStreamOptions = { highWaterMark? : number, decodeString? : boolean, objectMode? : boolean };
Expand All @@ -1696,6 +1695,7 @@ declare class stream$Writable extends stream$Stream {
encoding: string,
callback: (error: ?Error, data?: Buffer | string) => void
): boolean;
destroy(error?: Error): this;
}

//According to the NodeJS docs:
Expand Down
Loading

0 comments on commit 306096a

Please sign in to comment.