From fe50f106b09934b55bba7d01f61dca3885516718 Mon Sep 17 00:00:00 2001 From: Rich Adams Date: Wed, 4 Nov 2015 16:02:57 -0800 Subject: [PATCH] Adding DefaultsOptions that allows for optional uri and url when using the defaults function --- request/request.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/request/request.d.ts b/request/request.d.ts index e7edc39b8..43e62b203 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -21,7 +21,7 @@ declare module 'request' { function RequestAPI(options: RequestAPI.Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): RequestAPI.Request; module RequestAPI { - export function defaults(options: Options): typeof RequestAPI; + export function defaults(options: DefaultsOptions): typeof RequestAPI; export function request(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request; export function request(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request; @@ -97,6 +97,11 @@ declare module 'request' { gzip?: boolean; } + export interface DefaultsOptions extends OptionalOptions { + url?: string, + uri?: string + } + export type Options = (UriOptions|UrlOptions)&OptionalOptions; export interface RequestPart {