import { Disposable, IDisposable } from "../../../../../base/common/lifecycle.js";
import { IObservable, IReader, ITransaction } from "../../../../../base/common/observable.js";
import { ICommandService } from "../../../../../platform/commands/common/commands.service.js";
import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js";
import { IContextKeyService } from "../../../../../platform/contextkey/common/contextkey.service.js";
import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js";
import { ILogService } from "../../../../../platform/log/common/log.service.js";
import { Position } from "../../../../common/core/position.js";
import { Range } from "../../../../common/core/range.js";
import { SingleTextEdit } from "../../../../common/core/textEdit.js";
import { InlineCompletionContext } from "../../../../common/languages.js";
import { ILanguageConfigurationService } from "../../../../common/languages/languageConfigurationRegistry.js";
import { ITextModel } from "../../../../common/model.js";
import { IFeatureDebounceInformation } from "../../../../common/services/languageFeatureDebounce.js";
import { ILanguageFeaturesService } from "../../../../common/services/languageFeatures.js";
import { InlineCompletionItem, InlineCompletionProviderResult } from "./provideInlineCompletions.js";
export declare class InlineCompletionsSource extends Disposable {
    private readonly _textModel;
    private readonly _versionId;
    private readonly _debounceValue;
    private readonly _languageFeaturesService;
    private readonly _languageConfigurationService;
    private readonly _logService;
    private readonly _configurationService;
    private readonly _instantiationService;
    private static _requestId;
    private readonly _updateOperation;
    readonly inlineCompletions: import("../../../../../base/common/observable.js").ISettableObservable<UpToDateInlineCompletions | undefined, void> & IDisposable;
    readonly suggestWidgetInlineCompletions: import("../../../../../base/common/observable.js").ISettableObservable<UpToDateInlineCompletions | undefined, void> & IDisposable;
    private readonly _loggingEnabled;
    private readonly _structuredFetchLogger;
    constructor(_textModel: ITextModel, _versionId: IObservable<number | null>, _debounceValue: IFeatureDebounceInformation, _languageFeaturesService: ILanguageFeaturesService, _languageConfigurationService: ILanguageConfigurationService, _logService: ILogService, _configurationService: IConfigurationService, _instantiationService: IInstantiationService);
    private _log;
    readonly loading: import("../../../../../base/common/observable.js").ISettableObservable<boolean, void>;
    fetch(position: Position, context: InlineCompletionContext, activeInlineCompletion: InlineCompletionWithUpdatedRange | undefined): Promise<boolean>;
    clear(tx: ITransaction): void;
    clearSuggestWidgetInlineCompletions(tx: ITransaction): void;
    cancelUpdate(): void;
}
declare class UpdateRequest {
    readonly position: Position;
    readonly context: InlineCompletionContext;
    readonly versionId: number;
    constructor(position: Position, context: InlineCompletionContext, versionId: number);
    satisfies(other: UpdateRequest): boolean;
    get isExplicitRequest(): boolean;
}
export declare class UpToDateInlineCompletions implements IDisposable {
    private readonly inlineCompletionProviderResult;
    readonly request: UpdateRequest;
    private readonly _textModel;
    private readonly _versionId;
    private readonly _inlineCompletions;
    get inlineCompletions(): ReadonlyArray<InlineCompletionWithUpdatedRange>;
    private _refCount;
    private readonly _prependedInlineCompletionItems;
    constructor(inlineCompletionProviderResult: InlineCompletionProviderResult, request: UpdateRequest, _textModel: ITextModel, _versionId: IObservable<number | null>);
    clone(): this;
    dispose(): void;
    prepend(inlineCompletion: InlineCompletionItem, range: Range, addRefToSource: boolean): void;
}
export declare class InlineCompletionWithUpdatedRange {
    readonly inlineCompletion: InlineCompletionItem;
    readonly decorationId: string;
    private readonly _textModel;
    private readonly _modelVersion;
    readonly request: UpdateRequest;
    readonly semanticId: string;
    get forwardStable(): boolean;
    private readonly _updatedRange;
    constructor(inlineCompletion: InlineCompletionItem, decorationId: string, _textModel: ITextModel, _modelVersion: IObservable<number | null>, request: UpdateRequest);
    toInlineCompletion(reader: IReader | undefined): InlineCompletionItem;
    toSingleTextEdit(reader: IReader | undefined): SingleTextEdit;
    isVisible(model: ITextModel, cursorPosition: Position, reader: IReader | undefined): boolean;
    canBeReused(model: ITextModel, position: Position): boolean;
    private _toFilterTextReplacement;
}
interface IRecordableLogEntry {
    sourceId: string;
    time: number;
}
export interface IRecordableEditorLogEntry extends IRecordableLogEntry {
    modelUri: string;
    modelVersion: number;
}
export declare function formatRecordableLogEntry<T extends IRecordableLogEntry>(entry: T): string;
export declare class StructuredLogger<T extends IRecordableLogEntry> extends Disposable {
    private readonly _contextKey;
    private readonly _contextKeyService;
    private readonly _commandService;
    static cast<T extends IRecordableLogEntry>(): typeof StructuredLogger<T>;
    private readonly _contextKeyValue;
    constructor(_contextKey: string, _contextKeyService: IContextKeyService, _commandService: ICommandService);
    readonly isEnabled: IObservable<boolean, unknown>;
    log(data: T): boolean;
}
export declare function observableContextKey<T>(key: string, contextKeyService: IContextKeyService): IObservable<T | undefined>;
export {};
