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

docs(ts): fix some d.ts #2144

Merged
merged 2 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion docs/source/en/basics/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = app => {
// app/controller/user.js
class UserController extends Controller {
async info() {
this.ctx.body = {
const { ctx } = this;
ctx.body = {
name: `hello ${ctx.params.id}`,
};
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh-cn/basics/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = app => {
class UserController extends Controller {
async info() {
const { ctx } = this;
this.ctx.body = {
ctx.body = {
name: `hello ${ctx.params.id}`,
};
}
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ interface Request extends KoaApplication.Request { // tslint:disable-line
*/
query: { [key: string]: string };

body: RequestArrayBody | RequestObjectBody;
body: any;
}

interface Response extends KoaApplication.Response { // tslint:disable-line
Expand Down Expand Up @@ -471,7 +471,7 @@ declare interface EggApplication extends KoaApplication { // tslint:disable-line
* 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(url: string, opt?: RequestOptions): Promise<any>;

/**
* Get logger by name, it's equal to app.loggers['name'], but you can extend it with your own logical
Expand Down Expand Up @@ -733,7 +733,7 @@ export interface Context extends KoaApplication.Context {
* 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(url: string, opt?: RequestOptions): Promise<any>;

/**
* Get logger by name, it's equal to app.loggers['name'], but you can extend it with your own logical
Expand Down