This should all work, but doesn't. I have the following typescript code:
module LayoutEngine {
class WorkerApi {
private worker : Worker;
constructor() {
debugger;
this.worker = new Worker("layout-worker.js");
}
And I am trying to create this object in javascript:
require(["../common/events", "worker-api.js"], function (events) {
var api = new LayoutEngine.WorkerApi();
But I get Uncaught TypeError: undefined is not a function
and in the debugger LayoutEngine does evaluate as an object but LayoutEngine.WorkerApi resolves as undefined
.
What am I missing in my declaration to create it?