My worker-api.ts file is:
export class WorkerApi {
private worker:Worker;
constructor() {
this.worker = new Worker("layout-worker.js");
}
// more ...
}
And I am trying to create the in javascript as follows:
require(["../common/events.js", "worker-api.js"], function (events, worker) {
// worker is null so worker.WorkerApi() won't work either.
var api = new WorkerApi();
I also tried with internal modules so it was named MyModule.WorkerApi() - that also failed (we are using external modules for our .ts files).
What am I missing? I'm guessing I need to set something in the .ts file so the requires passes an object in function (events, worker) but can't find what it is.
thanks - dave