mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Merge pull request #12824 from ethanresnick/superagent-callback-fix
Superagent callback fix
This commit is contained in:
4
superagent/index.d.ts
vendored
4
superagent/index.d.ts
vendored
@@ -49,7 +49,7 @@ declare namespace request {
|
||||
search(url: string, callback?: CallbackHandler): Req;
|
||||
connect(url: string, callback?: CallbackHandler): Req;
|
||||
|
||||
parse(fn: (res: Response, callback: (err: Error, body: any) => void) => void): this;
|
||||
parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this;
|
||||
saveCookies(res: Response): void;
|
||||
attachCookies(req: Req): void;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ declare namespace request {
|
||||
withCredentials(): this;
|
||||
write(data: string, encoding?: string): this;
|
||||
write(data: Buffer, encoding?: string): this;
|
||||
parse(fn: (res: Response, callback: (err: Error, body: any) => void) => void): this;
|
||||
parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ request
|
||||
request
|
||||
.get('/search')
|
||||
.then((response) => {})
|
||||
.catch((error) => {});
|
||||
.catch((error) => {});
|
||||
// Requesting binary data.
|
||||
// adapted from: https://github.com/visionmedia/superagent/blob/v2.0.0/test/client/request.js#L110
|
||||
request
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Reference in New Issue
Block a user