-
Notifications
You must be signed in to change notification settings - Fork 24
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: add typescript support #28
Conversation
index.d.ts
Outdated
rawArgv: string[]; | ||
env: PlainObject; | ||
argv: Arguments<PlainObject>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不止这些的,还有 execArgv, execArgvObj 等几个
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加上了
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
=======================================
Coverage 97.52% 97.52%
=======================================
Files 3 3
Lines 202 202
=======================================
Hits 197 197
Misses 5 5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
=======================================
Coverage 97.52% 97.52%
=======================================
Files 3 3
Lines 202 202
=======================================
Hits 197 197
Misses 5 5
Continue to review full report at Codecov.
|
index.d.ts
Outdated
|
||
// migrating to common-bin later | ||
declare class CommonBin { | ||
options: Options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个当时设计的有点特殊,只是一个 setter,然后是 merge 的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那是不用写出来?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不写也行吧,我在 plus 里面提供了 initOptions 这个 protect 来提供
index.d.ts
Outdated
* @param {Array} context.rawArgv - the raw argv, `[ "--baseDir=simple" ]` | ||
* @protected | ||
*/ | ||
protected run(context?: CommonBin.Context): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该是允许返回的吧?是不是要 any ?
/** | ||
* start point of bin process | ||
*/ | ||
start(): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个好像是 promise 的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start 里是直接跑 co ,没有 return
2.8.1 |
Checklist
npm test
passesAffected core subsystem(s)
Description of change
add typescript support