Making a module callable

typescript

Solution

No, it is not possible. The only entity that can match a call signature is a function

interface ITest{
    ():string;
}

var x:ITest = function() {return "";}
var y:ITest = () => "";

Problem

Modules in typescript are compatible with interfaces. e.g. the following is valid: ``` module M{ var s = "test" export function f(){ return s; } } interface ITest{ f():string; } var x:ITest = M; ``` However is it possible to have a callable signature in a module? Specifically how can I write a module compatible with the following interface: ``` interface ITest{ ():string; } ```

Original source