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

chore(typings): change export interface to class definition #2293

Merged
merged 19 commits into from
Apr 3, 2018
Merged
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
19 changes: 9 additions & 10 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,19 +854,18 @@ declare module 'egg' {
* Singleton instance in Agent Worker, extend {@link EggApplication}
*/
class Agent extends EggApplication {
_wrapMessenger(): void
}

export interface ClusterOptions {
framework: string // specify framework that can be absolute path or npm package
baseDir: string // directory of application, default to `process.cwd()`
plugins: object // customized plugins, for unittest
workers: number // numbers of app workers, default to `os.cpus().length`
port: number // listening port, default to 7001(http) or 8443(https)
https: boolean // https or not
key: string //ssl key
cert: string // ssl cert
typescript: boolean
framework: string; // specify framework that can be absolute path or npm package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样的注释,在 vscode 那边能看到提示么?
是不是要用 jsdoc 的方式来做注释?

Copy link
Contributor Author

@waitingsong waitingsong Mar 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是 vsc ,鼠标 ctrl+hover时 可以显示注释内容的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

framework / baseDir / workers 都是可选的

baseDir: string; // directory of application, default to `process.cwd()`
plugins: object; // customized plugins, for unittest
workers: number; // numbers of app workers, default to `os.cpus().length`
port: number; // listening port, default to 7001(http) or 8443(https)
https: boolean; // https or not
key: string; //ssl key
cert: string; // ssl cert
// typescript: boolean;
}

export function startCluster(options: ClusterOptions, callback: () => any): void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一样,加一下 ;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void 后面也顺手加个 ;

Expand Down