import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IWebWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/webWorker/browser/webWorkerService.service"; import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service"; /** * Create a new web worker that has model syncing capabilities built in. * Specify an AMD module to load that will `create` an object that will be proxied. */ export declare function createWebWorker(modelService: IModelService, webWorkerService: IWebWorkerService, opts: IInternalWebWorkerOptions): MonacoWebWorker; /** * A web worker that can provide a proxy to an arbitrary file. */ export interface MonacoWebWorker { /** * Terminate the web worker, thus invalidating the returned proxy. */ dispose(): void; /** * Get a proxy to the arbitrary loaded code. */ getProxy(): Promise; /** * Synchronize (send) the models at `resources` to the web worker, * making them available in the monaco.worker.getMirrorModels(). */ withSyncedResources(resources: URI[]): Promise; } export interface IInternalWebWorkerOptions { /** * The worker. */ worker: Worker | Promise; /** * An object that can be used by the web worker to make calls back to the main thread. */ host?: Record; /** * Keep idle models. * Defaults to false, which means that idle models will stop syncing after a while. */ keepIdleModels?: boolean; }