-
-
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: improve d.ts with ts support #2306
Changes from 3 commits
fe94253
20264f2
efb29bd
b875997
06a0357
603a7ac
1abcef9
0a357c2
c088b2c
76b08eb
4585b86
56ff3e2
26a3a74
ff21f75
f1711b5
bbca0c0
37b9b77
4205e9b
e63fbaa
745cb27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,6 +165,29 @@ declare module 'egg' { | |
|
||
export type LoggerLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE'; | ||
|
||
/** | ||
* egg app info | ||
* @example | ||
* ```js | ||
* // config/config.default.ts | ||
* import { EggAppInfo } from 'egg'; | ||
* | ||
* export default (appInfo: EggAppInfo) => { | ||
* return { | ||
* keys: appInfo.name + '123456', | ||
* }; | ||
* } | ||
* ``` | ||
*/ | ||
export interface EggAppInfo { | ||
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. 这个哪里有文档么?我当时看着文档写的,这些地段哪里那的? 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. 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. @shepherdwind 之前你们 example 那边写的 config 理解有问题。
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. 不过 appConfig 这个没几个人知道,哈哈 |
||
pkg: string; // package.json | ||
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. 这里错了, pkg 是 json 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. 哦,我改一下 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. rebase 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. 改了 |
||
name: string; // the application name from package.json | ||
baseDir: string; // current directory of application | ||
env: string; // equals to serverEnv | ||
HOME: string; // home directory of the OS | ||
root: string; // baseDir when local and unittest, HOME when other environment | ||
} | ||
|
||
export interface EggAppConfig { | ||
workerStartTimeout: number; | ||
baseDir: string; | ||
|
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.
顶部加个. jsdoc?说明下这个用在哪里的,如给个 config 的示例
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.
加了