mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4477 from LeandroDG/patch-1
Adding basic authentication support and typed the response
This commit is contained in:
Vendored
+27
-25
@@ -15,40 +15,40 @@ declare module 'request' {
|
||||
|
||||
export = RequestAPI;
|
||||
|
||||
function RequestAPI(uri: string, options?: RequestAPI.Options, callback?: (error: any, response: any, body: any) => void): RequestAPI.Request;
|
||||
function RequestAPI(uri: string, callback?: (error: any, response: any, body: any) => void): RequestAPI.Request;
|
||||
function RequestAPI(options: RequestAPI.Options, callback?: (error: any, response: any, body: any) => void): RequestAPI.Request;
|
||||
function RequestAPI(uri: string, options?: RequestAPI.Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): RequestAPI.Request;
|
||||
function RequestAPI(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): RequestAPI.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 request(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function request(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function request(options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
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;
|
||||
export function request(options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function get(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function get(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function get(options: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function get(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function get(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function get(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function post(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function post(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function post(options: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function post(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function post(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function post(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function put(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function put(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function put(options: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function put(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function put(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function put(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function head(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function head(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function head(options: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function head(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function head(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function head(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function patch(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function patch(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function patch(options: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function patch(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function patch(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function patch(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function del(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function del(uri: string, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function del(options: Options, callback?: (error: any, response: any, body: any) => void): Request;
|
||||
export function del(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function del(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
export function del(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): Request;
|
||||
|
||||
export function forever(agentOptions: any, optionsArg: any): Request;
|
||||
export function jar(): CookieJar;
|
||||
@@ -59,9 +59,10 @@ declare module 'request' {
|
||||
export interface Options {
|
||||
url?: string;
|
||||
uri?: string;
|
||||
callback?: (error: any, response: any, body: any) => void;
|
||||
callback?: (error: any, response: http.IncomingMessage, body: any) => void;
|
||||
jar?: any; // CookieJar
|
||||
form?: any; // Object or string
|
||||
auth?: AuthOptions;
|
||||
oauth?: OAuthOptions;
|
||||
aws?: AWSOptions;
|
||||
hawk ?: HawkOptions;
|
||||
@@ -107,6 +108,7 @@ declare module 'request' {
|
||||
multipart(multipart: RequestPart[]): Request;
|
||||
json(val: any): Request;
|
||||
aws(opts: AWSOptions, now?: boolean): Request;
|
||||
auth(username: string, password: string, sendInmediately?: boolean, bearer?: string): Request;
|
||||
oauth(oauth: OAuthOptions): Request;
|
||||
jar(jar: CookieJar): Request;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user