import { RangeInFileWithContents } from "../commands/util.js";
import { ConfigHandler } from "../config/handler.js";
import { IDE, ILLM, Position, Range, TabAutocompleteOptions } from "../index.js";
import { AutocompleteLanguageInfo } from "./languages.js";
import { AutocompleteSnippet } from "./ranking.js";
import { RecentlyEditedRange } from "./recentlyEdited.js";
import { GeneratorReuseManager } from "./util.js";
export interface AutocompleteInput {
    completionId: string;
    filepath: string;
    pos: Position;
    recentlyEditedFiles: RangeInFileWithContents[];
    recentlyEditedRanges: RecentlyEditedRange[];
    clipboardText: string;
    manuallyPassFileContents?: string;
    manuallyPassPrefix?: string;
    selectedCompletionInfo?: {
        text: string;
        range: Range;
    };
    injectDetails?: string;
}
export interface AutocompleteOutcome extends TabAutocompleteOptions {
    accepted?: boolean;
    time: number;
    prompt: string;
    completion: string;
    modelProvider: string;
    modelName: string;
    completionOptions: any;
    cacheHit: boolean;
    filepath: string;
}
export type GetLspDefinitionsFunction = (filepath: string, contents: string, cursorIndex: number, ide: IDE, lang: AutocompleteLanguageInfo) => Promise<AutocompleteSnippet[]>;
export declare function getTabCompletion(token: AbortSignal, options: TabAutocompleteOptions, llm: ILLM, ide: IDE, generatorReuseManager: GeneratorReuseManager, input: AutocompleteInput, getDefinitionsFromLsp: GetLspDefinitionsFunction): Promise<AutocompleteOutcome | undefined>;
export declare class CompletionProvider {
    private readonly configHandler;
    private readonly ide;
    private readonly getLlm;
    private readonly _onError;
    private readonly getDefinitionsFromLsp;
    private static debounceTimeout;
    private static debouncing;
    private static lastUUID;
    constructor(configHandler: ConfigHandler, ide: IDE, getLlm: () => Promise<ILLM | undefined>, _onError: (e: any) => void, getDefinitionsFromLsp: GetLspDefinitionsFunction);
    private generatorReuseManager;
    private autocompleteCache;
    errorsShown: Set<string>;
    private onError;
    cancel(): void;
    private _abortControllers;
    private _logRejectionTimeouts;
    private _outcomes;
    accept(completionId: string): void;
    cancelRejectionTimeout(completionId: string): void;
    provideInlineCompletionItems(input: AutocompleteInput, token: AbortSignal | undefined): Promise<AutocompleteOutcome | undefined>;
    _lastDisplayedCompletion: {
        id: string;
        displayedAt: number;
    } | undefined;
    markDisplayed(completionId: string, outcome: AutocompleteOutcome): void;
}
//# sourceMappingURL=completionProvider.d.ts.map