mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Tightens the public API
This commit is contained in:
parent
166e63b991
commit
5ee395c5ee
3 changed files with 17 additions and 16 deletions
|
|
@ -1,19 +1,14 @@
|
|||
// This example uses @typescript/vfs to create a virtual TS program
|
||||
// which can do work on a bg thread.
|
||||
|
||||
// This version of the vfs edits the global scope (in the case of a webworker, this is 'self')
|
||||
importScripts("https://unpkg.com/@typescript/vfs@1.3.0/dist/vfs.globals.js")
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {import("../src/tsWorker").TypeScriptWorker} TypeScriptWorker
|
||||
* @param {import("typescript")} ts
|
||||
* @param {Record<string, string>} libFileMap
|
||||
*
|
||||
*/
|
||||
const worker = (TypeScriptWorker, ts, libFileMap) => {
|
||||
/** @type { import("@typescript/vfs") } */
|
||||
const tsvfs = globalThis.tsvfs
|
||||
/** @type { import("@typescript/vfs") } */
|
||||
const tsvfs = globalThis.tsvfs
|
||||
|
||||
/** @type {import("../src/tsWorker").CustomTSWebWorkerFactory }*/
|
||||
const worker = (TypeScriptWorker, ts, libFileMap) => {
|
||||
return class MonacoTSWorker extends TypeScriptWorker {
|
||||
|
||||
// Adds a custom function to the webworker
|
||||
|
|
@ -59,7 +54,6 @@ const worker = (TypeScriptWorker, ts, libFileMap) => {
|
|||
recurse(mainSrcFile, 0)
|
||||
return miniAST
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue