mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-23 00:22:56 +01:00
Make a useful sample
This commit is contained in:
parent
26d78129fa
commit
3e1a236812
2 changed files with 27 additions and 17 deletions
|
|
@ -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) || ""
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue