mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
12 lines
392 B
JavaScript
12 lines
392 B
JavaScript
self.customTSWorkerFactory = (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) || ""
|
|
}
|
|
|
|
}
|
|
}
|