From 212a50f62c1c39f9cc1ca2a5cbd6b2f3a25d58ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Mon, 26 Dec 2016 14:49:49 +0100 Subject: [PATCH] Add RequestOptions to Response object --- request/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/request/index.d.ts b/request/index.d.ts index 0dff82cfa3..6e5043cf9d 100644 --- a/request/index.d.ts +++ b/request/index.d.ts @@ -75,7 +75,7 @@ declare namespace request { interface CoreOptions { baseUrl?: string; - callback?: (error: any, response: http.IncomingMessage, body: any) => void; + callback?: (error: any, response: RequestResponse, body: any) => void; jar?: any; // CookieJar formData?: any; // Object form?: any; // Object or string @@ -134,9 +134,13 @@ declare namespace request { export type Options = OptionsWithUri | OptionsWithUrl; export interface RequestCallback { - (error: any, response: http.IncomingMessage, body: any): void; + (error: any, response: RequestResponse, body: any): void; } + export interface RequestResponse extends http.IncomingMessage { + request: Options; + } + export interface HttpArchiveRequest { url?: string; method?: string;