-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore(typings): change export interface to class definition #2293
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2293 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 29 29
Lines 749 749
=======================================
Hits 746 746
Misses 3 3 Continue to review full report at Codecov.
|
relevant issue: eggjs#2292
for this usage: // lib/agent.ts
import * as path from 'path'
import {Agent as EggAgent} from 'egg'
export const EGG_PATH = Symbol.for('egg#eggPath');
export default class Agent extends EggAgent {
get [EGG_PATH]() {
return path.dirname(__dirname);
}
} |
使用 样例代码库 中 |
index.d.ts
Outdated
* Singleton instance in Agent Worker, extend {@link EggApplication} | ||
*/ | ||
class Agent extends EggApplication { | ||
_wrapMessenger(): 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.
这个 _wrapMessenger 是非暴露的方法把,我觉得不需要加进来
index.d.ts
Outdated
https: boolean // https or not | ||
key: string //ssl key | ||
cert: string // ssl cert | ||
typescript: boolean |
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.
typescript
这个入参,我记得我们当初定的时候,不是给用户用的吧?@atian25 ,应该不需要加进来?
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.
还有就是,统一一下规范,加一下 ;
index.d.ts
Outdated
typescript: boolean | ||
} | ||
|
||
export function startCluster(options: ClusterOptions, callback: () => any): 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.
一样,加一下 ;
index.d.ts
Outdated
key: string //ssl key | ||
cert: string // ssl cert | ||
typescript: boolean | ||
framework: string; // specify framework that can be absolute path or npm package |
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.
这样的注释,在 vscode 那边能看到提示么?
是不是要用 jsdoc 的方式来做注释?
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.
如果是 vsc ,鼠标 ctrl+hover时 可以显示注释内容的
plugins, port, https, key, cert, typescript
index.d.ts
Outdated
// typescript?: boolean; | ||
} | ||
|
||
export function startCluster(options: ClusterOptions, callback: () => any): 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.
void 后面也顺手加个 ;
呗
index.d.ts
Outdated
} | ||
|
||
export interface ClusterOptions { | ||
framework: string; // specify framework that can be absolute path or npm package |
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.
framework / baseDir / workers 都是可选的
chore(typings): change export interface to class definition (#2293)
issue: #2292
Checklist
npm test
passesAffected core subsystem(s)
Description of change
issue link