Fix implicit any issues

This commit is contained in:
Joe Skeen
2015-10-07 10:01:23 -06:00
parent 31d1cc43cd
commit b06d25ff7a
3 changed files with 57 additions and 59 deletions

49
request/request.d.ts vendored
View File

@@ -18,36 +18,33 @@ declare module 'request' {
namespace request {
export interface RequestAPI<TRequest extends Request> {
defaults(options: Options): RequestAPI<TRequest>;
(uri: string,
options?: Options,
callback?: (error: any, response: http.IncomingMessage, body: any) => void)
: TRequest;
(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
(options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
(uri: string, options?: Options, callback?: RequestCallback): TRequest;
(uri: string, callback?: RequestCallback): TRequest;
(options?: Options, callback?: RequestCallback): TRequest;
get(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
get(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
get(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
get(uri: string, options?: Options, callback?: RequestCallback): TRequest;
get(uri: string, callback?: RequestCallback): TRequest;
get(options: Options, callback?: RequestCallback): TRequest;
post(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
post(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
post(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
post(uri: string, options?: Options, callback?: RequestCallback): TRequest;
post(uri: string, callback?: RequestCallback): TRequest;
post(options: Options, callback?: RequestCallback): TRequest;
put(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
put(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
put(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
put(uri: string, options?: Options, callback?: RequestCallback): TRequest;
put(uri: string, callback?: RequestCallback): TRequest;
put(options: Options, callback?: RequestCallback): TRequest;
head(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
head(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
head(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
head(uri: string, options?: Options, callback?: RequestCallback): TRequest;
head(uri: string, callback?: RequestCallback): TRequest;
head(options: Options, callback?: RequestCallback): TRequest;
patch(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
patch(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
patch(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
patch(uri: string, options?: Options, callback?: RequestCallback): TRequest;
patch(uri: string, callback?: RequestCallback): TRequest;
patch(options: Options, callback?: RequestCallback): TRequest;
del(uri: string, options?: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
del(uri: string, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
del(options: Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): TRequest;
del(uri: string, options?: Options, callback?: RequestCallback): TRequest;
del(uri: string, callback?: RequestCallback): TRequest;
del(options: Options, callback?: RequestCallback): TRequest;
forever(agentOptions: any, optionsArg: any): TRequest;
jar(): CookieJar;
@@ -97,6 +94,10 @@ declare module 'request' {
har?: HttpArchiveRequest;
}
export interface RequestCallback {
(error: any, response: http.IncomingMessage, body: any): void;
}
export interface HttpArchiveRequest {
url?: string;
method?: string;