import type { CompletionItemKind } from "#enums/completionItemKind";
import type { ModuleKind } from "#enums/moduleKind";
import type { __String, Path } from "../ast/index.ts";
import type { CompilerOptions } from "./compilerOptions.ts";
export type { CompilerOptions } from "./compilerOptions.ts";
/**
 * A document identifier that can be either a file name (path string) or a document URI object.
 *
 * @example
 * // Using a file name
 * project.program.getSourceFile("/path/to/file.ts");
 *
 * // Using a URI
 * project.program.getSourceFile({ uri: "file:///path/to/file.ts" });
 */
export type DocumentIdentifier = string | {
    uri: string;
};
/**
 * A tsconfig to open/load. The object form may carry the client's effective
 * compiler options (its merged CLI + tsconfig + extends parse); when present
 * they replace the project's disk-parsed options, while file expansion still
 * comes from the disk config. CLI-only flags never appear in the on-disk
 * tsconfig, so clients whose options can outrun the tsconfig (tsc) must send
 * them; clients whose options live entirely in the tsconfig (LSP) may send a
 * plain DocumentIdentifier as before.
 */
export type OpenProjectIdentifier = DocumentIdentifier | {
    fileName: string;
    compilerOptions?: Record<string, unknown>;
};
/**
 * A position within a document, combining a document identifier with an offset.
 */
export interface DocumentPosition {
    /** The document containing the position */
    document: DocumentIdentifier;
    /** The character offset within the document */
    position: number;
}
/**
 * Resolves a DocumentIdentifier to a file name.
 * If the identifier contains a URI, it is converted to a file name.
 */
export declare function resolveFileName(identifier: DocumentIdentifier): string;
/**
 * Resolves a DocumentIdentifier to a document URI.
 * If the identifier contains a file name, it is converted to a URI.
 */
export declare function resolveDocumentURI(identifier: DocumentIdentifier): string;
/**
 * Response from the initialize method.
 */
export interface InitializeResponse {
    /** Whether the host file system is case-sensitive */
    useCaseSensitiveFileNames: boolean;
    /** The server's current working directory */
    currentDirectory: string;
}
export interface ConfigResponse {
    options: Record<string, unknown>;
    fileNames: string[];
}
export interface LSPUpdateSnapshotParams {
    /**
     * @deprecated Use {@link openProjects} instead.
     * Path to a tsconfig.json file to open in the new snapshot.
     */
    openProject?: string;
    /**
     * tsconfig.json files to open/load in the new snapshot. Opens are ref-counted
     * and persist across snapshots until closed via {@link closeProjects}.
     * Entries carrying `compilerOptions` replace the project's disk-parsed
     * options with the client's effective options (see OpenProjectIdentifier).
     */
    openProjects?: OpenProjectIdentifier[];
    /**
     * tsconfig.json files to release in the new snapshot. A project is only unloaded
     * once every API client that opened it closes it.
     */
    closeProjects?: DocumentIdentifier[];
    /**
     * Files to keep open for the API client, mirroring LSP's `textDocument/didOpen`.
     * For each file, ancestor directories are searched for a tsconfig that contains it;
     * if one is found, that configured project is loaded and becomes the file's default
     * project. Otherwise the file is loaded into the inferred project (e.g. a d.ts in
     * node_modules that is not part of any project's import graph). Opens persist across
     * subsequent snapshots until the file is closed via {@link closeFiles}.
     * After calling updateSnapshot with openFiles, getDefaultProjectForFile returns the
     * resolved configured or inferred project.
     */
    openFiles?: DocumentIdentifier[];
    /**
     * Files to release in the new snapshot. A file is only fully closed once every
     * API client that opened it closes it.
     */
    closeFiles?: DocumentIdentifier[];
}
export interface FileChangeSummary {
    changed?: DocumentIdentifier[];
    created?: DocumentIdentifier[];
    deleted?: DocumentIdentifier[];
}
export type FileChanges = FileChangeSummary | {
    invalidateAll: true;
};
/**
 * Parameters for updateSnapshot.
 */
export interface UpdateSnapshotParams extends LSPUpdateSnapshotParams {
    fileChanges?: FileChanges;
}
/**
 * Builds the wire request for updateSnapshot, applying the deprecated `openProject`
 * compatibility shim: a single `openProject` is folded into `openProjects` and is
 * never sent on the wire.
 */
export declare function toUpdateSnapshotRequest(params?: UpdateSnapshotParams): UpdateSnapshotParams;
/**
 * Changes to source files within a single project.
 */
export interface ProjectFileChanges {
    /** Source file paths whose content changed */
    changedFiles?: string[];
    /** Source file paths removed from the project's program */
    deletedFiles?: string[];
    /**
     * Source file paths newly present in the project's program. Blob caches
     * need no invalidation for these (no stale entry can exist), but
     * whole-program answers (builder file graph, source-file names) must not
     * treat the project as unchanged.
     */
    addedFiles?: string[];
}
/**
 * Changes between two consecutive snapshots, reported per-project.
 */
export interface SnapshotChanges {
    /** Project handles mapped to their file changes. Projects not listed are unchanged. */
    changedProjects?: Record<string, ProjectFileChanges>;
    /** Project handles that were removed from the snapshot */
    removedProjects?: string[];
}
/**
 * Response from updateSnapshot.
 */
export interface UpdateSnapshotResponse {
    /** Handle for the newly created snapshot */
    snapshot: number;
    /** List of projects in the snapshot */
    projects: ProjectResponse[];
    /** Changes from the previous snapshot (absent for the first snapshot) */
    changes?: SnapshotChanges;
}
export interface ProjectResponse {
    id: Path;
    configFileName: string;
    compilerOptions: CompilerOptions;
    rootFiles: string[];
}
export interface SourceFileResponse {
    /** Base64-encoded binary AST data */
    data: string;
}
export interface SourceFileMetadata {
    isDefaultLibrary: boolean;
    isFromExternalLibrary: boolean;
    packageJsonType: string;
    packageJsonDirectory: string;
    impliedNodeFormat: ModuleKind;
}
export interface SymbolResponse {
    id: number;
    /**
     * The project the symbol was first observed in. Used as the default project for
     * follow-up lookups that need a project context (e.g. members/exports), since symbols
     * are shared snapshot-wide and such lookups can vary by project.
     * Optional on the wire: TNB light payloads (ambient modules, export map,
     * scope dedup) may omit it; node resolution then falls back to the
     * requesting registry's project.
     */
    project?: Path;
    name: __String;
    flags: number;
    checkFlags: number;
    declarations?: string[];
    valueDeclaration?: string;
    parent?: number;
    exportSymbol?: number;
}
export interface ResolvedReferenceEntry {
    start: number;
    position: number;
    symbolId: number;
}
export interface LightSymbolResponse {
    id: number;
    project?: Path;
    name: __String;
    flags: number;
    checkFlags: number;
    parent?: number;
}
export interface GetResolvedReferencesInFileResponse {
    references: ResolvedReferenceEntry[];
    symbols: LightSymbolResponse[];
}
/**
 * Dedup response shape for getSymbolsInScope: `known` ids were already
 * materialized client-side by an earlier dedup response for the same snapshot;
 * `symbols` carries full payloads for first-seen symbols.
 */
export interface GetSymbolsInScopeResponse {
    known?: number[];
    symbols?: SymbolResponse[];
}
export interface TypeResponse {
    id: number;
    flags: number;
    objectFlags?: number;
    /** Literal value. BigInt literals are encoded as a decimal string (e.g. "-123") since JSON cannot represent bigint. Absent values are serialized as null. */
    value?: string | number | boolean | null;
    freshType?: number;
    regularType?: number;
    target?: number;
    typeParameters?: number[];
    outerTypeParameters?: number[];
    localTypeParameters?: number[];
    elementFlags?: number[];
    fixedLength?: number;
    readonly?: boolean;
    objectType?: number;
    indexType?: number;
    checkType?: number;
    extendsType?: number;
    baseType?: number;
    substConstraint?: number;
    texts?: string[];
    intrinsicName?: string;
    isThisType?: boolean;
    aliasTypeArguments?: number[];
    aliasSymbol?: number;
    symbol?: number;
}
export interface ObjectExpressionMemberResponse {
    type: TypeResponse;
    promisedType?: TypeResponse;
}
export interface ObjectExpressionFinalMemberResponse {
    type: TypeResponse;
    isArrayLike?: boolean;
    invalidDueToUnionDiscriminant?: boolean;
    hasCallOrConstructSignatures?: boolean;
    /** Apparent properties, populated only for class members. */
    apparentProperties?: SymbolResponse[];
}
/**
 * Composite result of the stock Completions.getPropertiesForObjectExpression
 * pipeline, computed server-side in one round trip so the client can seed its
 * per-call checker caches.
 */
export interface GetPropertiesForObjectExpressionResponse {
    members: ObjectExpressionMemberResponse[];
    promiseFilteredType: TypeResponse;
    mergedType?: TypeResponse;
    finalMembers?: ObjectExpressionFinalMemberResponse[];
    /** Final union members surviving the filter, in union order. */
    filteredTypes?: number[];
    properties?: SymbolResponse[];
}
export interface SignatureResponse {
    id: number;
    flags: number;
    declaration?: string;
    typeParameters?: number[];
    parameters?: number[];
    thisParameter?: number;
    target?: number;
}
export interface TypePredicateResponse {
    kind: number;
    parameterIndex: number;
    parameterName?: string;
    type?: TypeResponse;
}
export interface IndexInfoResponse {
    keyType: TypeResponse;
    valueType: TypeResponse;
    isReadonly?: boolean;
    declaration?: string;
}
export interface ProfileParams {
    dir: string;
}
export interface ProfileResult {
    file: string;
}
export interface CompletionEntryLabelDetailsResponse {
    detail?: string;
    description?: string;
}
export interface CompletionEntryResponse {
    name: string;
    kind?: CompletionItemKind;
    sortText?: string;
    insertText?: string;
    filterText?: string;
    detail?: string;
    labelDetails?: CompletionEntryLabelDetailsResponse;
    symbol?: SymbolResponse;
}
export interface CompletionInfoResponse {
    isIncomplete: boolean;
    entries: CompletionEntryResponse[];
}
//# sourceMappingURL=proto.d.ts.map