Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(index.d.ts): curl 增加泛型 #3197

Merged
merged 2 commits into from
Nov 16, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ declare module 'egg' {
* Keep the same api with httpclient.request(url, args).
* See https://github.com/node-modules/urllib#api-doc for more details.
*/
curl(url: string, opt?: RequestOptions): Promise<any>;
curl<T = any>(url: string, opt?: RequestOptions): Promise<T>;

/**
* Get logger by name, it's equal to app.loggers['name'], but you can extend it with your own logical
Expand Down Expand Up @@ -891,7 +891,7 @@ declare module 'egg' {
* Keep the same api with httpclient.request(url, args).
* See https://github.com/node-modules/urllib#api-doc for more details.
*/
curl(url: string, opt?: RequestOptions): Promise<any>;
curl<T = any>(url: string, opt?: RequestOptions): Promise<T>;

/**
* Render a file by view engine
Expand Down