Improve typings

Add optional flag to the `HttpResponse.end()` argument.
This commit is contained in:
treble-snake 2019-03-07 01:47:43 +03:00 committed by GitHub
parent d36b08a289
commit eb8c48fc80
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];