import * as embedded from '@volar/language-core';
import * as embeddedLS from '@volar/language-service';
import * as path from 'typesafe-path';
import type * as ts from 'typescript/lib/tsserverlibrary';
import { URI } from 'vscode-uri';
import { WorkspaceContext } from './workspace';
export interface ProjectContext {
    workspace: WorkspaceContext;
    rootUri: URI;
    tsConfig: path.PosixPath | ts.CompilerOptions;
    documentRegistry: ts.DocumentRegistry | undefined;
}
export type Project = ReturnType<typeof createProject>;
export declare function createProject(context: ProjectContext): Promise<{
    tsConfig: ts.CompilerOptions | path.PosixPath;
    scripts: {
        clear: () => void;
        values: () => IterableIterator<{
            version: number;
            fileName: string;
            snapshot: ts.IScriptSnapshot | undefined;
            snapshotVersion: number | undefined;
        }>;
        uriDelete: (_uri: string) => boolean;
        uriGet: (_uri: string) => {
            version: number;
            fileName: string;
            snapshot: ts.IScriptSnapshot | undefined;
            snapshotVersion: number | undefined;
        } | undefined;
        uriHas: (_uri: string) => boolean;
        uriSet: (_uri: string, item: {
            version: number;
            fileName: string;
            snapshot: ts.IScriptSnapshot | undefined;
            snapshotVersion: number | undefined;
        }) => void;
        pathDelete: (path: string) => boolean;
        pathGet: (path: string) => {
            version: number;
            fileName: string;
            snapshot: ts.IScriptSnapshot | undefined;
            snapshotVersion: number | undefined;
        } | undefined;
        pathHas: (path: string) => {
            version: number;
            fileName: string;
            snapshot: ts.IScriptSnapshot | undefined;
            snapshotVersion: number | undefined;
        } | undefined;
        pathSet: (path: string, item: {
            version: number;
            fileName: string;
            snapshot: ts.IScriptSnapshot | undefined;
            snapshotVersion: number | undefined;
        }) => void;
    };
    languageServiceHost: embedded.LanguageServiceHost;
    getLanguageService: () => {
        triggerCharacters: string[];
        autoFormatTriggerCharacters: string[];
        signatureHelpTriggerCharacters: string[];
        signatureHelpRetriggerCharacters: string[];
        format: (uri: string, options: embeddedLS.FormattingOptions, range: embeddedLS.Range | undefined, onTypeParams: {
            ch: string;
            position: embeddedLS.Position;
        } | undefined, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.TextEdit[] | undefined>;
        getFoldingRanges: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.FoldingRange[] | undefined>;
        getSelectionRanges: (uri: string, positions: embeddedLS.Position[], token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.SelectionRange[] | undefined>;
        findLinkedEditingRanges: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LinkedEditingRanges | undefined>;
        findDocumentSymbols: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.DocumentSymbol[] | undefined>;
        findDocumentColors: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.ColorInformation[] | undefined>;
        getColorPresentations: (uri: string, color: embeddedLS.Color, range: embeddedLS.Range, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.ColorPresentation[] | undefined>;
        doValidation: (uri: string, mode: "semantic" | "all" | "syntactic", token?: embeddedLS.CancellationToken | undefined, response?: ((result: embeddedLS.Diagnostic[]) => void) | undefined) => Promise<embeddedLS.Diagnostic[]>;
        findReferences: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.Location[] | undefined>;
        findFileReferences: (uri: string, token?: embeddedLS.CancellationToken | undefined) => embeddedLS.NullableResult<embeddedLS.Location[]>;
        findDefinition: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LocationLink[] | undefined>;
        findTypeDefinition: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LocationLink[] | undefined>;
        findImplementations: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LocationLink[] | undefined>;
        prepareRename: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<NonNullable<embeddedLS.Range | embeddedLS.ResponseError<void> | null | undefined> | undefined>;
        doRename: (uri: string, position: embeddedLS.Position, newName: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.WorkspaceEdit | undefined>;
        getEditsForFileRename: (oldUri: string, newUri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.WorkspaceEdit | undefined>;
        getSemanticTokens: (uri: string, range: embeddedLS.Range | undefined, legend: embeddedLS.SemanticTokensLegend, token?: embeddedLS.CancellationToken | undefined, reportProgress?: ((tokens: embeddedLS.SemanticTokens) => void) | undefined) => Promise<embeddedLS.SemanticTokens | undefined>;
        doHover: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.Hover | undefined>;
        doComplete: (uri: string, position: embeddedLS.Position, completionContext?: embeddedLS.CompletionContext | undefined, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CompletionList>;
        doCodeActions: (uri: string, range: embeddedLS.Range, codeActionContext: embeddedLS.CodeActionContext, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeAction[] | undefined>;
        doCodeActionResolve: (item: embeddedLS.CodeAction, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeAction>;
        doCompletionResolve: (item: embeddedLS.CompletionItem, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CompletionItem>;
        getSignatureHelp: (uri: string, position: embeddedLS.Position, signatureHelpContext?: embeddedLS.SignatureHelpContext | undefined, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.SignatureHelp | undefined>;
        doCodeLens: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeLens[]>;
        doCodeLensResolve: (item: embeddedLS.CodeLens, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeLens>;
        findDocumentHighlights: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.DocumentHighlight[] | undefined>;
        findDocumentLinks: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.DocumentLink[]>;
        doDocumentLinkResolve: (item: embeddedLS.CodeLens, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeLens>;
        findWorkspaceSymbols: (query: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.WorkspaceSymbol[]>;
        doAutoInsert: (uri: string, position: embeddedLS.Position, autoInsertContext: embeddedLS.AutoInsertionContext, token?: embeddedLS.CancellationToken | undefined) => Promise<NonNullable<string | embeddedLS.TextEdit | null | undefined> | undefined>;
        getInlayHints: (uri: string, range: embeddedLS.Range, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.InlayHint[] | undefined>;
        doInlayHintResolve: (item: embeddedLS.InlayHint, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.InlayHint>;
        callHierarchy: {
            doPrepare(uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined): Promise<embeddedLS.CallHierarchyItem[] | undefined>;
            getIncomingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyIncomingCall[]>;
            getOutgoingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyOutgoingCall[]>;
        };
        dispose: () => void | undefined;
        context: embeddedLS.LanguageServicePluginContext;
    };
    getLanguageServiceDontCreate: () => {
        triggerCharacters: string[];
        autoFormatTriggerCharacters: string[];
        signatureHelpTriggerCharacters: string[];
        signatureHelpRetriggerCharacters: string[];
        format: (uri: string, options: embeddedLS.FormattingOptions, range: embeddedLS.Range | undefined, onTypeParams: {
            ch: string;
            position: embeddedLS.Position;
        } | undefined, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.TextEdit[] | undefined>;
        getFoldingRanges: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.FoldingRange[] | undefined>;
        getSelectionRanges: (uri: string, positions: embeddedLS.Position[], token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.SelectionRange[] | undefined>;
        findLinkedEditingRanges: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LinkedEditingRanges | undefined>;
        findDocumentSymbols: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.DocumentSymbol[] | undefined>;
        findDocumentColors: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.ColorInformation[] | undefined>;
        getColorPresentations: (uri: string, color: embeddedLS.Color, range: embeddedLS.Range, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.ColorPresentation[] | undefined>;
        doValidation: (uri: string, mode: "semantic" | "all" | "syntactic", token?: embeddedLS.CancellationToken | undefined, response?: ((result: embeddedLS.Diagnostic[]) => void) | undefined) => Promise<embeddedLS.Diagnostic[]>;
        findReferences: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.Location[] | undefined>;
        findFileReferences: (uri: string, token?: embeddedLS.CancellationToken | undefined) => embeddedLS.NullableResult<embeddedLS.Location[]>;
        findDefinition: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LocationLink[] | undefined>;
        findTypeDefinition: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LocationLink[] | undefined>;
        findImplementations: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.LocationLink[] | undefined>;
        prepareRename: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<NonNullable<embeddedLS.Range | embeddedLS.ResponseError<void> | null | undefined> | undefined>;
        doRename: (uri: string, position: embeddedLS.Position, newName: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.WorkspaceEdit | undefined>;
        getEditsForFileRename: (oldUri: string, newUri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.WorkspaceEdit | undefined>;
        getSemanticTokens: (uri: string, range: embeddedLS.Range | undefined, legend: embeddedLS.SemanticTokensLegend, token?: embeddedLS.CancellationToken | undefined, reportProgress?: ((tokens: embeddedLS.SemanticTokens) => void) | undefined) => Promise<embeddedLS.SemanticTokens | undefined>;
        doHover: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.Hover | undefined>;
        doComplete: (uri: string, position: embeddedLS.Position, completionContext?: embeddedLS.CompletionContext | undefined, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CompletionList>;
        doCodeActions: (uri: string, range: embeddedLS.Range, codeActionContext: embeddedLS.CodeActionContext, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeAction[] | undefined>;
        doCodeActionResolve: (item: embeddedLS.CodeAction, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeAction>;
        doCompletionResolve: (item: embeddedLS.CompletionItem, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CompletionItem>;
        getSignatureHelp: (uri: string, position: embeddedLS.Position, signatureHelpContext?: embeddedLS.SignatureHelpContext | undefined, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.SignatureHelp | undefined>;
        doCodeLens: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeLens[]>;
        doCodeLensResolve: (item: embeddedLS.CodeLens, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeLens>;
        findDocumentHighlights: (uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.DocumentHighlight[] | undefined>;
        findDocumentLinks: (uri: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.DocumentLink[]>;
        doDocumentLinkResolve: (item: embeddedLS.CodeLens, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.CodeLens>;
        findWorkspaceSymbols: (query: string, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.WorkspaceSymbol[]>;
        doAutoInsert: (uri: string, position: embeddedLS.Position, autoInsertContext: embeddedLS.AutoInsertionContext, token?: embeddedLS.CancellationToken | undefined) => Promise<NonNullable<string | embeddedLS.TextEdit | null | undefined> | undefined>;
        getInlayHints: (uri: string, range: embeddedLS.Range, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.InlayHint[] | undefined>;
        doInlayHintResolve: (item: embeddedLS.InlayHint, token?: embeddedLS.CancellationToken | undefined) => Promise<embeddedLS.InlayHint>;
        callHierarchy: {
            doPrepare(uri: string, position: embeddedLS.Position, token?: embeddedLS.CancellationToken | undefined): Promise<embeddedLS.CallHierarchyItem[] | undefined>;
            getIncomingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyIncomingCall[]>;
            getOutgoingCalls(item: embeddedLS.CallHierarchyItem, token: embeddedLS.CancellationToken): Promise<embeddedLS.CallHierarchyOutgoingCall[]>;
        };
        dispose: () => void | undefined;
        context: embeddedLS.LanguageServicePluginContext;
    } | undefined;
    getParsedCommandLine: () => ts.ParsedCommandLine;
    tryAddFile: (fileName: string) => void;
    dispose: () => void;
}>;
