From 5b97a8f59d36957a631b1290276e5a6571b913ad Mon Sep 17 00:00:00 2001 From: Kyle McCarthy Date: Mon, 4 Mar 2019 09:29:17 -0600 Subject: [PATCH] update onData handle, allow for user data to be attached to response --- docs/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/index.d.ts b/docs/index.d.ts index acfb30a..53a1026 100644 --- a/docs/index.d.ts +++ b/docs/index.d.ts @@ -67,10 +67,13 @@ interface HttpResponse { onAborted(handler: (res: HttpResponse) => void) : HttpResponse; /** Handler for reading data from POST and such requests. You MUST copy the data of chunk if isLast is not true. We Neuter ArrayBuffers on return, making it zero length.*/ - onData(handler: (res: HttpResponse, chunk: ArrayBuffer, isLast: boolean) => void) : HttpResponse; + onData(handler: (chunk: ArrayBuffer, isLast: boolean) => void) : HttpResponse; /** Returns the remote IP address */ getRemoteAddress() : ArrayBuffer; + + /** Arbitrary user data may be attached to this object */ + [key: string]: any; } /** An HttpRequest is stack allocated and only accessible during the callback invocation. */