From eb8c48fc8008fc8e839475acd4373f22b256d4bc Mon Sep 17 00:00:00 2001 From: treble-snake Date: Thu, 7 Mar 2019 01:47:43 +0300 Subject: [PATCH] Improve typings Add optional flag to the `HttpResponse.end()` argument. --- docs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.d.ts b/docs/index.d.ts index 953ceac..475d72f 100644 --- a/docs/index.d.ts +++ b/docs/index.d.ts @@ -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];