Merge pull request #83 from kyle-mccarthy/types
type definitions -- update onData handle, allow for user data to be attached to response
This commit is contained in:
commit
ba8deb5272
8
docs/index.d.ts
vendored
8
docs/index.d.ts
vendored
@ -33,6 +33,9 @@ interface WebSocket {
|
|||||||
|
|
||||||
/** Returns the remote IP address */
|
/** Returns the remote IP address */
|
||||||
getRemoteAddress() : ArrayBuffer;
|
getRemoteAddress() : ArrayBuffer;
|
||||||
|
|
||||||
|
/** Arbitrary user data may be attached to this object */
|
||||||
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object. */
|
/** An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object. */
|
||||||
@ -67,10 +70,13 @@ interface HttpResponse {
|
|||||||
onAborted(handler: (res: HttpResponse) => void) : 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.*/
|
/** 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 */
|
/** Returns the remote IP address */
|
||||||
getRemoteAddress() : ArrayBuffer;
|
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. */
|
/** An HttpRequest is stack allocated and only accessible during the callback invocation. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user