typescript 中的模块与接口兼容。例如以下是有效的:
module M{
var s = "test"
export function f(){
return s;
}
}
interface ITest{
f():string;
}
var x:ITest = M;
但是,模块中是否可以有可调用的签名?具体如何编写与以下接口兼容的模块:
interface ITest{
():string;
}
typescript 中的模块与接口兼容。例如以下是有效的:
module M{
var s = "test"
export function f(){
return s;
}
}
interface ITest{
f():string;
}
var x:ITest = M;
但是,模块中是否可以有可调用的签名?具体如何编写与以下接口兼容的模块:
interface ITest{
():string;
}