Adding DefaultsOptions that allows for optional uri and url when using the defaults function

This commit is contained in:
Rich Adams
2015-11-04 16:02:57 -08:00
parent 40f2f63de6
commit fe50f106b0
+6 -1
View File
@@ -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 {