這裏是代碼:類型簽名的立式功能
interface Foo
{
c : string
}
function foo()
{
var c = this.c
return c
}
foo.call({ c : "quux" })
Visual Studio中說,this : any
所以this.c
自動完成不起作用。如何添加一個簽名以告知this
Implemented Foo
因此IDE在foo
內部具有用於自動完成this.
的類型信息?