import { IDisposable } from "../../../base/common/lifecycle.js"; import { URI } from "../../../base/common/uri.js"; import { IWebWorkerServerRequestHandler } from "../../../base/common/worker/webWorker.js"; import { IRange } from "../core/range.js"; import { IMirrorTextModel, IModelChangedEvent } from "../model/mirrorTextModel.js"; import { IColorInformation, IInplaceReplaceSupportResult, ILink, TextEdit } from "../languages.js"; import { DiffAlgorithmName, IDiffComputationResult, IUnicodeHighlightsResult } from "./editorWorker.js"; import { UnicodeHighlighterOptions } from "./unicodeTextModelHighlighter.js"; import { IChange } from "../diff/legacyLinesDiffComputer.js"; import { ILinesDiffComputerOptions } from "../diff/linesDiffComputer.js"; import { IDocumentDiffProviderOptions } from "@codingame/monaco-vscode-chat-service-override/vscode/vs/editor/common/diff/documentDiffProvider"; import { FindSectionHeaderOptions, SectionHeader } from "./findSectionHeaders.js"; import { IRawModelData, IWorkerTextModelSyncChannelServer } from "./textModelSync/textModelSync.protocol.js"; import { ICommonModel } from "./textModelSync/textModelSync.impl.js"; import { ISerializedStringEdit, StringEdit } from "../core/edits/stringEdit.js"; export interface IMirrorModel extends IMirrorTextModel { readonly uri: URI; readonly version: number; getValue(): string; } export interface IWorkerContext { /** * A proxy to the main thread host object. */ host: H; /** * Get all available mirror models in this worker. */ getMirrorModels(): IMirrorModel[]; } /** * Range of a word inside a model. * @internal */ export interface IWordRange { /** * The index where the word starts. */ readonly start: number; /** * The index where the word ends. */ readonly end: number; } /** * @internal */ export declare class EditorWorker implements IDisposable, IWorkerTextModelSyncChannelServer, IWebWorkerServerRequestHandler { private readonly _foreignModule; _requestHandlerBrand: void; private readonly _workerTextModelSyncServer; constructor(_foreignModule?: unknown | null); dispose(): void; $ping(): Promise; protected _getModel(uri: string): ICommonModel | undefined; getModels(): ICommonModel[]; $acceptNewModel(data: IRawModelData): void; $acceptModelChanged(uri: string, e: IModelChangedEvent): void; $acceptRemovedModel(uri: string): void; $computeUnicodeHighlights(url: string, options: UnicodeHighlighterOptions, range?: IRange): Promise; $findSectionHeaders(url: string, options: FindSectionHeaderOptions): Promise; $computeDiff(originalUrl: string, modifiedUrl: string, options: IDocumentDiffProviderOptions, algorithm: DiffAlgorithmName): Promise; private static computeDiff; private static _modelsAreIdentical; $computeDirtyDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean): Promise; $computeStringDiff(original: string, modified: string, options: { maxComputationTimeMs: number; }, algorithm: DiffAlgorithmName): ISerializedStringEdit; private static readonly _diffLimit; $computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[], pretty: boolean): Promise; $computeHumanReadableDiff(modelUrl: string, edits: TextEdit[], options: ILinesDiffComputerOptions): TextEdit[]; $computeLinks(modelUrl: string): Promise; $computeDefaultDocumentColors(modelUrl: string): Promise; private static readonly _suggestionsLimit; $textualSuggest(modelUrls: string[], leadingWord: string | undefined, wordDef: string, wordDefFlags: string): Promise<{ words: string[]; duration: number; } | null>; $computeWordRanges(modelUrl: string, range: IRange, wordDef: string, wordDefFlags: string): Promise<{ [word: string]: IRange[]; }>; $navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): Promise; $fmr(method: string, args: unknown[]): Promise; } /** * @internal */ export declare function computeStringDiff(original: string, modified: string, options: { maxComputationTimeMs: number; }, algorithm: DiffAlgorithmName): StringEdit;