Skip to content

Commit

Permalink
chore: add urllib declaration support in index.d.ts (#2117)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraYama authored and dead-horse committed Feb 22, 2018
1 parent fd6fa24 commit 2d03c79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as accepts from 'accepts';
import * as KoaApplication from 'koa';
import * as KoaRouter from 'koa-router';
import { RequestOptions } from 'urllib';
import { Readable } from 'stream';
/**
* BaseContextClass is a base class that can be extended,
Expand Down Expand Up @@ -470,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: any): 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 @@ -732,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: any): 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@types/accepts": "^1.3.3",
"@types/koa": "^2.0.40",
"@types/koa-router": "^7.0.25",
"@types/urllib": "^2.25.0",
"accepts": "^1.3.4",
"agentkeepalive": "^3.3.0",
"cluster-client": "^1.7.1",
Expand Down

0 comments on commit 2d03c79

Please sign in to comment.