I have this setup:
//./things/Base.ts
export default class Base{
constructor(){
console.log("HI I AM A BASE THING");
}
}
//things.ts
import Base = require('./things/Base');
export = {
defaultThing: Base
};
//entry.ts
import Things = require('./things');
new Things.defaultThing();
What I'm trying to do is build a dictionary with the keys I want for classes of a given type, letting me change the underlying implementation without touching the consuming code. This fails with the following message
λ tsc entry.ts
entry.ts(3,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
Why is this and what's the proper idiom?