Tia*_*olo 3 express typescript typescript-typings
我像这样导入expressjs:
import { Request, Response, Application, Router } from 'express';
const app: Application = require('express')();
Run Code Online (Sandbox Code Playgroud)
在 types.json 中:
"express": "registry:npm/express#4.14.0+20160925001530",
Run Code Online (Sandbox Code Playgroud)
当我输入时app.close()
我得到:
[ts] Property 'close' does not exist on type 'Application'.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我可以在哪里报告此事?(如果这是一个错误)
我是唯一一个在打字稿上苦苦挣扎的人吗?
提供的 Application 定义没有 close...Server 方法,并且(app:Application).listen
返回一个 Server。
start(){
server = app.listen(options.port, function () {
debug('Server listening on port ' + options.port)
})
}
stop(){
server.close();
}
Run Code Online (Sandbox Code Playgroud)
打字稿很难。
归档时间: |
|
查看次数: |
5532 次 |
最近记录: |