在javascript中以下行的typescript中语义等价的语法是什么
//Some knockout event handler.
myFunc(data : string, evt : Event) {
//If enter or tab key up were detected add the excuse to the collection.
if(evt.enterKey || evt.which == 9)
//Do Something
}
Run Code Online (Sandbox Code Playgroud)
我遇到的麻烦不像常规的javascript事件,typescript事件类没有属性enterKey或which.那么如何在不获取打字稿编译错误和丑陋的红色摇摆下划线的情况下检测哪个键被按下?