Skip to content

Commit

Permalink
docs(ts): fix some d.ts (#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 authored Feb 28, 2018
1 parent e0282b9 commit c828436
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
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:/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:/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

0 comments on commit c828436

Please sign in to comment.