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

TypeScript: egg.Application 导出了接口而非类 #2292

Closed
waitingsong opened this issue Mar 29, 2018 · 2 comments
Closed

TypeScript: egg.Application 导出了接口而非类 #2292

waitingsong opened this issue Mar 29, 2018 · 2 comments
Assignees

Comments

@waitingsong
Copy link
Contributor

  • Node Version: 8.10.0
  • Egg Version: 2.4.10
  • Plugin Name:
  • Plugin Version:
  • Platform: win7
  • Mini Showcase Repository:

参照 框架扩展文档
用 TS 实现提示错误:

import * as path from 'path'
import { Application as EggApplication } from 'egg'

export const EGG_PATH = Symbol.for('egg#eggPath');

export default class Application extends EggApplication {
  get [EGG_PATH]() {
    return path.dirname(__dirname);
  }
}
@waitingsong
Copy link
Contributor Author

2018-03-29_203716

waitingsong added a commit to waitingsong/egg that referenced this issue Mar 29, 2018
waitingsong added a commit to waitingsong/egg that referenced this issue Mar 29, 2018
@waitingsong
Copy link
Contributor Author

waitingsong commented Mar 29, 2018

also error during this usage:

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);
  }
}

@atian25 atian25 closed this as completed Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants