Below is an example of a valid ES5, but it emits an error below. I am using Typescript 1.7.5 and I think I read the entire language specification and I cannot understand why this error occurs.
error TS2349: Cannot invoke an expression whose type lacks a call signature.
a.js (external ES5 module with default export)
function myfunc() { return "hello"; } module.exports = myfunc;
adts
declare module "test" { export default function (): string; }
b.ts
import test = require("test"); const app = test();
b.js (generated ES5):
var test = require("test"); var app = test()
source share