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;