-
-
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
Merged
+23
−2
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9081d66
chore(typings): change export interface to class definition
waitingsong f863f52
chore(typings): export class Agent
waitingsong da93979
chore(typings): export startCluster()
waitingsong 1b9954e
chore(typings): add ClusterOptions["typescript"]
waitingsong c0d53fe
fix(typings): typo
waitingsong 8e26715
style: add semicolon
waitingsong 4110d28
chore(typings): comment ClusterOptions["typescript"] out
waitingsong 2ba654d
chore(typings): remove Agent["_wrapMessenger"]
waitingsong 65c869b
chore(typings): change items of ClusterOptions optional
waitingsong af6a958
chore: add semicolon
waitingsong 3d2fc1b
Merge branch 'master' into ts
atian25 5effde9
chore(typings): update callback of startCluster()
waitingsong 1023621
Merge branch 'ts' of github.com:waitingsong/egg into ts
waitingsong 99b1439
chore(typings): add index signature of ClusterOptions
waitingsong b8ed59c
chore(typings): upate ClusterOptions["plugins"] can be null
waitingsong 0a61275
Merge branch 'master' into ts
waitingsong fd05cae
Merge branch 'master' into ts
atian25 62bd147
chore(typings): change framework, baseDir, workers of interface Clust…
waitingsong e16f76d
Merge branch 'master' into ts
atian25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,7 +377,7 @@ declare module 'egg' { | |
url(name: string, params: any): any; | ||
} | ||
|
||
interface EggApplication extends KoaApplication { // tslint:disable-line | ||
class EggApplication extends KoaApplication { // tslint:disable-line | ||
/** | ||
* The current directory of application | ||
*/ | ||
|
@@ -498,7 +498,7 @@ declare module 'egg' { | |
|
||
type RouterPath = string | RegExp; | ||
|
||
export interface Application extends EggApplication { | ||
class Application extends EggApplication { | ||
/** | ||
* global locals for view | ||
* @see Context#locals | ||
|
@@ -849,4 +849,25 @@ declare module 'egg' { | |
*/ | ||
urlFor(name: string, params?: { [key: string]: any }): string; | ||
} | ||
|
||
/** | ||
* Singleton instance in Agent Worker, extend {@link EggApplication} | ||
*/ | ||
class Agent extends EggApplication { | ||
} | ||
|
||
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 commentThe 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 | null; // 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; | ||
[prop: string]: any; | ||
} | ||
|
||
export function startCluster(options: ClusterOptions, callback: (...args: any[]) => any): void; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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时 可以显示注释内容的