Merge pull request #88 from treble-snake/patch-1

Improve typings: optional body for .end() method
This commit is contained in:
Alex Hultman 2019-03-07 03:35:30 +01:00 committed by GitHub
commit e76bbd9dd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
docs/index.d.ts vendored
View File

@ -47,7 +47,7 @@ interface HttpResponse {
/** Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. */
write(chunk: RecognizedString) : HttpResponse;
/** Ends this response by copying the contents of body. */
end(body: RecognizedString) : HttpResponse;
end(body?: RecognizedString) : HttpResponse;
/** Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].*/
tryEnd(fullBodyOrChunk: RecognizedString, totalSize: number) : [boolean, boolean];