diff --git a/src/generators/egg.ts b/src/generators/egg.ts index 9bc767e..e2d54fd 100644 --- a/src/generators/egg.ts +++ b/src/generators/egg.ts @@ -8,7 +8,14 @@ export default function(config: TsGenConfig, baseConfig: TsHelperConfig) { return { dist: path.resolve(config.dtsDir, 'index.d.ts'), content: + `import { Context, IService } from '${baseConfig.framework}';\n` + `export * from '${baseConfig.framework}';\n` + - 'export as namespace Egg;\n', + 'export as namespace Egg;\n\n' + + `\/\/ hack support for webstorm (intellij) +declare module 'egg' { + export interface Context { + service: IService; + } +}`, }; }