Make a useful sample

This commit is contained in:
Orta 2020-08-21 08:04:24 -04:00
parent 26d78129fa
commit 3e1a236812
2 changed files with 27 additions and 17 deletions

View file

@ -1,9 +1,14 @@
/// <reference lib="webworker">
console.log("worker")
self.extendTSWorkerFactory = (TypeScriptWorker) => {
return class MonacoTSWorker extends TypeScriptWorker {
// Adds a custom function to the webworker
async getDTSEmitForFile(fileName) {
const result = await this.getEmitOutput(fileName)
const firstDTS = result.outputFiles.find(o => o.name.endsWith(".d.ts"))
return (firstDTS && firstDTS.text) || ""
}
}
}