import type { CompletionContext } from "@codemirror/autocomplete"; import type { VirtualTypeScriptEnvironment } from "@typescript/vfs"; import type { Remote } from "comlink"; /** * The shape of the output of something like * * ```ts * Comlink.wrap(new Worker(…)); * ``` * * Most TypeScript environments won’t be able to figure out * the types of a `Worker` instance, so this is a helper * for casting. */ export type WorkerShape = Remote>; type Promisable = T | PromiseLike; interface InitializerOptions { env: Promisable; onFileUpdated?: (env: VirtualTypeScriptEnvironment, path: string, code: string) => unknown; } /** * Create a worker with `WorkerShape`, given an initializer * method. You might want to customize how your TypeScript * environment is set up, so the initializer can do all * of that: this then gives you an object that can be * passed to `Comlink.expose`. */ export declare function createWorker(_options: Promisable): { initialize(): Promise; /** * Usually used to hook into ATA */ updateFile({ path, code }: { path: string; code: string; }): void; getLints({ path, }: { path: string; }): import("@codemirror/lint").Diagnostic[]; getAutocompletion({ path, context, }: { path: string; context: Pick; }): Promise | null; getHover({ path, pos }: { path: string; pos: number; }): import("../hover/getHover.js").HoverInfo | null; getEnv(): VirtualTypeScriptEnvironment; }; export {}; //# sourceMappingURL=createWorker.d.ts.map