you shouldn't need :
declare module "modules/dialog/modal" {
var theModal: IModal;
export = theModal;
}
if you have a file fooModal.ts
as :
class modal implements IModal {
widgetNames: KnockoutObservableArray<string>;
widgets: KnockoutObservableArray<IWidget>;
constructor() {
this.widgetNames= ko.observable<string>(['widget1','widget2'])
}
}
export = modal;
You can simply do:
import modal = require('./fooModal');
class index{
constructor(){
var_modal = new modal();//problem here, unable to create modal. not compiled; i don't want to use singleton pattern;
}
}
export = index;