/// <reference path="../node/node.d.ts" preserve="true" />
import { CompletionItemKind } from "#enums/completionItemKind";
import { DiagnosticCategory } from "#enums/diagnosticCategory";
import { ElementFlags } from "#enums/elementFlags";
import { ModuleKind } from "#enums/moduleKind";
import { NodeBuilderFlags } from "#enums/nodeBuilderFlags";
import { ObjectFlags } from "#enums/objectFlags";
import { SignatureFlags } from "#enums/signatureFlags";
import { SignatureKind } from "#enums/signatureKind";
import { SymbolFlags } from "#enums/symbolFlags";
import { TypeFlags } from "#enums/typeFlags";
import { TypePredicateKind } from "#enums/typePredicateKind";
import { type __String, type Expression, type Identifier, ModifierFlags, type Node, type Path, type SourceFile, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
import type { APIOptions, LSPConnectionOptions } from "../options.ts";
import type { CompilerOptions, ConfigResponse, DocumentIdentifier, DocumentPosition, LSPUpdateSnapshotParams, ProjectResponse, SignatureResponse, SourceFileMetadata, SymbolResponse, TypeResponse, UpdateSnapshotParams, UpdateSnapshotResponse } from "../proto.ts";
import { SourceFileCache } from "../sourceFileCache.ts";
import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, Diagnostic, FreshableType, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, NumberLiteralType, ObjectType, StringLiteralType, StringMappingType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType } from "./types.ts";
export { documentURIToFileName, fileNameToDocumentURI } from "../path.ts";
export { CompletionItemKind, DiagnosticCategory, ElementFlags, ModifierFlags, ModuleKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypePredicateKind };
export type { APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, Diagnostic, DocumentIdentifier, DocumentPosition, FreshableType, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, NumberLiteralType, ObjectType, RequestTiming, SourceFileMetadata, StringLiteralType, StringMappingType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType };
export declare class API<FromLSP extends boolean = false> {
    private client;
    private sourceFileCache;
    private toPath;
    private initialized;
    private activeSnapshots;
    private latestSnapshot;
    readonly internal: InternalAPI;
    constructor(options?: APIOptions | LSPConnectionOptions);
    /**
     * Create an API instance from an existing LSP connection's API session.
     * Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
     */
    static fromLSPConnection(options: LSPConnectionOptions): Promise<API<true>>;
    private ensureInitialized;
    parseConfigFile(file: DocumentIdentifier): Promise<ConfigResponse>;
    updateSnapshot(params?: FromLSP extends true ? LSPUpdateSnapshotParams : UpdateSnapshotParams): Promise<Snapshot>;
    close(): Promise<void>;
    clearSourceFileCache(): void;
    /**
     * Returns a snapshot of collected timing information for requests made
     * through this API instance: client-measured round-trip latency and bytes
     * transferred, folded together with the server's own per-request processing
     * time and an estimated transport overhead (round-trip minus server time).
     *
     * Fetching the snapshot issues a lightweight request to the server to
     * retrieve its timing collection. Collection must be enabled via the
     * `collectTiming` option; when it is not, the returned snapshot has
     * `enabled: false` and zeroed totals.
     */
    getTimingInfo(): Promise<TimingInfo>;
    /** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
    resetTimingInfo(): Promise<void>;
}
export declare class InternalAPI {
    private client;
    private ensureInitialized;
    /** @internal */
    constructor(client: Client, ensureInitialized: () => Promise<void>);
    startCPUProfile(dir: string): Promise<void>;
    stopCPUProfile(): Promise<string>;
    saveHeapProfile(dir: string): Promise<string>;
}
export declare class Snapshot {
    readonly id: number;
    private projectMap;
    private toPath;
    private client;
    private disposed;
    private onDispose;
    private snapshotRegistry;
    constructor(data: UpdateSnapshotResponse, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, onDispose: () => void);
    getProjects(): readonly Project[];
    getProject(configFileName: string): Project | undefined;
    getDefaultProjectForFile(file: DocumentIdentifier): Promise<Project | undefined>;
    [globalThis.Symbol.dispose](): void;
    dispose(): Promise<void>;
    isDisposed(): boolean;
    private ensureNotDisposed;
}
declare class SnapshotObjectRegistry {
    private readonly symbols;
    private readonly client;
    private readonly snapshotId;
    private readonly resolveProject;
    constructor(client: Client, snapshotId: number, resolveProject: (projectId: Path) => Project | undefined);
    /** Resolve a project id (a config file path) to its Project within this snapshot. */
    getProject(projectId: Path): Project | undefined;
    getOrCreateSymbol(data: SymbolResponse): Symbol;
    getSymbol(id: number): Symbol | undefined;
    clear(): void;
    fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined, projectId?: Path): Promise<Symbol>;
    fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[], projectId?: Path): Promise<readonly Symbol[]>;
    materializeSymbols(symbolIds: readonly number[]): Promise<(Symbol | undefined)[]>;
}
declare class ProjectObjectRegistry {
    private client;
    private snapshotId;
    private project;
    private snapshotRegistry;
    private types;
    private signatures;
    constructor(client: Client, snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry);
    getOrCreateSymbol(data: SymbolResponse): Symbol;
    getSymbol(id: number): Symbol | undefined;
    getOrCreateType(data: TypeResponse): TypeObject;
    getType(id: number): TypeObject | undefined;
    getOrCreateSignature(data: SignatureResponse): Signature;
    getSignature(id: number): Signature | undefined;
    clear(): void;
    fetchType<T extends Type>(source: Symbol | Signature | Type, method: string, handle: number | false | undefined): Promise<T>;
    fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined): Promise<Symbol>;
    fetchSignature(source: Symbol | Signature | Type, method: string, handle: number | undefined): Promise<Signature>;
    fetchTypes(source: Symbol | Signature | Type, method: string, handles?: readonly number[]): Promise<readonly Type[]>;
    fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[]): Promise<readonly Symbol[]>;
    fetchBaseTypes(source: Type): Promise<readonly Type[]>;
    materializeSymbols(symbolIds: readonly number[]): Promise<(Symbol | undefined)[]>;
    getParameterType(signature: Signature, index: number): Promise<Type>;
}
export declare class Project {
    readonly id: Path;
    readonly configFileName: string;
    readonly compilerOptions: CompilerOptions;
    readonly rootFiles: readonly string[];
    readonly program: Program;
    readonly checker: Checker;
    readonly emitter: Emitter;
    private client;
    constructor(data: ProjectResponse, snapshotId: number, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, snapshotRegistry: SnapshotObjectRegistry);
    dispose(): void;
}
export declare class Program {
    private snapshotId;
    private project;
    private client;
    private sourceFileCache;
    private toPath;
    private decoder;
    private sourceFileMetadataCache;
    constructor(snapshotId: number, project: Project, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path);
    getCompilerOptions(): CompilerOptions;
    getSourceFile(file: DocumentIdentifier): Promise<SourceFile | undefined>;
    getSourceFileNames(): Promise<readonly string[]>;
    /**
     * Returns program-stored metadata for the given source file, or `undefined` if the file
     * is not part of the program. Metadata is fetched lazily per file and cached on this
     * `Program` instance.
     */
    getSourceFileMetadata(fileName: string): Promise<SourceFileMetadata | undefined>;
    /**
     * Returns program-stored metadata for the source file at the given path, or `undefined`
     * if the file is not part of the program. Like {@link getSourceFileMetadata}, but skips
     * the file name to path conversion. Metadata is fetched lazily per file and cached on
     * this `Program` instance.
     */
    getSourceFileMetadataByPath(path: Path): Promise<SourceFileMetadata | undefined>;
    private fetchSourceFileMetadata;
    /**
     * Returns whether the given source file was loaded as part of an external library
     * (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
     * fetched lazily per file and cached on this `Program` instance.
     */
    isSourceFileFromExternalLibrary(file: SourceFile): Promise<boolean>;
    /**
     * Returns whether the given source file is a default library file (e.g. `lib.d.ts`).
     * The underlying program metadata is fetched lazily per file and cached on this
     * `Program` instance.
     */
    isSourceFileDefaultLibrary(file: SourceFile): Promise<boolean>;
    /**
     * Builder-state metadata for every program file in one batch: content-hash
     * version, referenced-file edges (canonical tsgo paths), global-scope
     * effect and implied module format. Computed with the same graph walk
     * tsgo's own incremental buildinfo uses; no semantic pass runs.
     */
    getBuilderFileGraph(): Promise<readonly {
        fileName: string;
        version: string;
        affectsGlobalScope?: boolean;
        impliedNodeFormat?: number;
        refs?: readonly string[];
    }[]>;
    /** Batch-fetch multiple source files in one RPC (binary AST blobs). */
    getSourceFiles(files: readonly DocumentIdentifier[]): Promise<(SourceFile | undefined)[]>;
    /** Warm the source-file cache for many paths in batched RPCs (chunk size 64). */
    prefetchSourceFiles(fileNames: readonly string[], chunkSize?: number): Promise<void>;
    /**
     * Get syntactic (parse) diagnostics for a specific file or all files.
     * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
     */
    getSyntacticDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
    /**
     * Get binder diagnostics for a specific file or all files.
     * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
     */
    getBindDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
    /**
     * Get semantic (type-check) diagnostics for a specific file or all files.
     * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
     */
    getSemanticDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
    /**
     * Get suggestion diagnostics for a specific file or all files.
     * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
     */
    getSuggestionDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
    /**
     * Get declaration emit diagnostics for a specific file or all files.
     * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
     */
    getDeclarationDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
    /**
     * Get program-wide diagnostics for the project, including compiler options diagnostics.
     */
    getProgramDiagnostics(): Promise<readonly Diagnostic[]>;
    /**
     * Get global (non-file-specific) semantic diagnostics for the project.
     */
    getGlobalDiagnostics(): Promise<readonly Diagnostic[]>;
    /**
     * Get config file parsing diagnostics for the project.
     */
    getConfigFileParsingDiagnostics(): Promise<readonly Diagnostic[]>;
    getCompilerOptionsForFile(file: DocumentIdentifier): Promise<any>;
    getImpliedNodeFormatForEmit(file: DocumentIdentifier): Promise<number | undefined>;
    getDefaultResolutionModeForFile(file: DocumentIdentifier): Promise<number | undefined>;
    getEmitModuleFormatOfFile(file: DocumentIdentifier): Promise<number>;
    getModeForUsageLocation(file: DocumentIdentifier, position: number): Promise<number | undefined>;
    getEmitSyntaxForUsageLocation(file: DocumentIdentifier, position: number): Promise<number | undefined>;
    getRedirectTargets(file: DocumentIdentifier): Promise<readonly string[]>;
}
export declare class Checker {
    private snapshotId;
    private project;
    private client;
    private objectRegistry;
    private wellKnownSymbols;
    constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
    dispose(): void;
    /** Lightweight ambient-module index (names + symbols only — no exports). */
    getAmbientModules(): Promise<{
        modules: readonly {
            moduleName: string;
            moduleSymbol: Symbol;
        }[];
    }>;
    /** Auto-import export index for every external/ambient module in one batch. */
    getModuleExportMap(importingFile?: DocumentIdentifier): Promise<{
        modules: readonly {
            moduleFileName?: string | undefined;
            moduleName: string;
            moduleSymbol: Symbol;
            importableFrom?: boolean | undefined;
            defaultExport?: {
                symbol: Symbol;
                tableKey: string;
                exportKind: number;
                targetFlags: number;
            } | undefined;
            namedExports: readonly {
                symbol: Symbol;
                key: string;
                targetFlags: number;
            }[];
        }[];
    }>;
    /** Batch-resolve auto-import module specifiers for many module symbols. */
    getModuleSpecifiersBatch(file: DocumentIdentifier, moduleSymbols: readonly Symbol[], preferences?: {
        importModuleSpecifierPreference?: string;
        importModuleSpecifierEnding?: string;
        autoImportSpecifierExcludeRegexes?: readonly string[];
    }): Promise<{
        results: readonly {
            moduleSymbol: Symbol;
            kind?: string | undefined;
            moduleSpecifiers: readonly string[];
        }[];
    }>;
    getSymbolAtLocation(node: Node): Promise<Symbol | undefined>;
    getSymbolAtLocation(nodes: readonly Node[]): Promise<(Symbol | undefined)[]>;
    getSymbolAtPosition(file: DocumentIdentifier, position: number): Promise<Symbol | undefined>;
    getSymbolAtPosition(file: DocumentIdentifier, positions: readonly number[]): Promise<(Symbol | undefined)[]>;
    getTypeOfSymbol(symbol: Symbol): Promise<Type | undefined>;
    getTypeOfSymbol(symbols: readonly Symbol[]): Promise<(Type | undefined)[]>;
    /**
     * Get the declared type of a symbol. Always returns a type; for symbols whose
     * declared type cannot be determined the checker yields the error type (use
     * {@link Type.isErrorType} to detect it).
     */
    getDeclaredTypeOfSymbol(symbol: Symbol): Promise<Type>;
    getReferencesToSymbolInFile(file: DocumentIdentifier, symbol: Symbol): Promise<NodeHandle[]>;
    getReferencedSymbolsForNode(node: Node, position: number): Promise<ReferencedSymbolEntry[]>;
    getSignatureUsage(signatureDecl: Node): Promise<SignatureUsage[]>;
    getCompletionsAtPosition(document: string, position: number, options?: CompletionOptions): Promise<CompletionInfo | undefined>;
    getTypeAtLocation(node: Node): Promise<Type | undefined>;
    getTypeAtLocation(nodes: readonly Node[]): Promise<(Type | undefined)[]>;
    getSignaturesOfType(type: Type, kind: SignatureKind): Promise<readonly Signature[]>;
    getResolvedSignature(node: Node): Promise<Signature | undefined>;
    getResolvedSignatureForSignatureHelp(node: Node, argumentCount?: number): Promise<{
        resolved: Signature | undefined;
        candidates: Signature[];
    }>;
    getExpandedParameters(signature: Signature, skipUnionExpanding?: boolean): Promise<readonly (readonly Symbol[])[]>;
    hasEffectiveRestParameter(signature: Signature): Promise<boolean>;
    symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: number): Promise<Node | undefined>;
    getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol: Symbol): Promise<readonly Type[] | undefined>;
    getContextualTypeForObjectLiteralElement(element: Node, contextFlags?: number): Promise<Type | undefined>;
    isOptionalParameter(node: Node): Promise<boolean>;
    isImplementationOfOverload(node: Node): Promise<boolean>;
    getTypeAtPosition(file: DocumentIdentifier, position: number): Promise<Type | undefined>;
    getTypeAtPosition(file: DocumentIdentifier, positions: readonly number[]): Promise<(Type | undefined)[]>;
    getSymbolsInScope(location: Node, meaning: SymbolFlags): Promise<readonly Symbol[]>;
    resolveName(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Promise<Symbol | undefined>;
    getResolvedSymbol(node: Identifier): Promise<Symbol | undefined>;
    getContextualType(node: Expression): Promise<Type | undefined>;
    getBaseTypeOfLiteralType(type: Type): Promise<Type | undefined>;
    getNonNullableType(type: Type): Promise<Type | undefined>;
    getNonOptionalType(type: Type): Promise<Type | undefined>;
    getTypeFromTypeNode(node: TypeNode): Promise<Type | undefined>;
    getWidenedType(type: Type): Promise<Type | undefined>;
    getParameterType(signature: Signature, index: number): Promise<Type | undefined>;
    isArrayLikeType(type: Type): Promise<boolean>;
    isTypeAssignableTo(source: Type, target: Type): Promise<boolean>;
    getUnionType(types: readonly Type[], unionReduction?: number): Promise<Type | undefined>;
    getPromisedTypeOfPromise(type: Type): Promise<Type | undefined>;
    getAllPossiblePropertiesOfTypes(types: readonly Type[]): Promise<readonly Symbol[]>;
    isTypeInvalidDueToUnionDiscriminant(type: Type, node: Node): Promise<boolean>;
    typeHasCallOrConstructSignatures(type: Type): Promise<boolean>;
    /**
     * Composite RPC: runs the stock Completions.getPropertiesForObjectExpression
     * pipeline server-side in one round trip and returns every intermediate
     * verdict so callers can answer the per-member checker calls from cache.
     */
    getPropertiesForObjectExpression(contextualType: Type, completionsType: Type | undefined, location: Node): Promise<ObjectExpressionCompletionInfo | undefined>;
    getShorthandAssignmentValueSymbol(node: Node): Promise<Symbol | undefined>;
    /**
     * Get the type of a symbol as narrowed at a specific location. Always returns
     * a type; for symbols whose type cannot be determined the checker yields the
     * error type (use {@link Type.isErrorType} to detect it).
     */
    getTypeOfSymbolAtLocation(symbol: Symbol, location: Node): Promise<Type>;
    private getIntrinsicType;
    getAnyType(): Promise<Type>;
    getErrorType(): Promise<Type>;
    getPromiseType(): Promise<Type>;
    getPromiseLikeType(): Promise<Type>;
    getAnyAsyncIterableType(): Promise<Type | undefined>;
    getStringType(): Promise<Type>;
    getNumberType(): Promise<Type>;
    getBooleanType(): Promise<Type>;
    getVoidType(): Promise<Type>;
    getUndefinedType(): Promise<Type>;
    getNullType(): Promise<Type>;
    getNeverType(): Promise<Type>;
    getUnknownType(): Promise<Type>;
    getBigIntType(): Promise<Type>;
    getESSymbolType(): Promise<Type>;
    typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: number): Promise<TypeNode | undefined>;
    typeParameterToDeclaration(type: Type, enclosingDeclaration?: Node, flags?: number): Promise<Node | undefined>;
    symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration?: Node, flags?: number): Promise<Node[]>;
    signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Promise<Node | undefined>;
    signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: number): Promise<string>;
    typeToString(type: Type, enclosingDeclaration?: Node, flags?: number): Promise<string>;
    isContextSensitive(node: Node): Promise<boolean>;
    isArrayType(type: Type): Promise<boolean>;
    isTupleType(type: Type): Promise<boolean>;
    isDeclarationVisible(node: Node): Promise<boolean>;
    tryGetThisTypeAt(node: Node, includeGlobalThis?: boolean, container?: Node): Promise<Type | undefined>;
    isValidPropertyAccessForCompletions(node: Node, type: Type, property: Symbol): Promise<boolean>;
    getTypeArgumentConstraint(node: Node): Promise<Type | undefined>;
    getExportsAndPropertiesOfModule(moduleSymbol: Symbol): Promise<readonly Symbol[]>;
    getJsxIntrinsicTagNamesAt(location: Node): Promise<readonly Symbol[]>;
    isPropertyAccessible(node: Node, isSuper: boolean, isWrite: boolean, containingType: Type, property: Symbol): Promise<boolean>;
    getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: number, useOnlyExternalAliasing: boolean): Promise<readonly Symbol[] | undefined>;
    getContextualTypeForArgumentAtIndex(callTarget: Node, argIndex: number): Promise<Type | undefined>;
    getContextualTypeForJsxAttribute(attribute: Node): Promise<Type | undefined>;
    isValidPropertyAccess(node: Node, propertyName: string): Promise<boolean>;
    getCandidateSignaturesForStringLiteralCompletions(call: Node, editingArgument: Node): Promise<readonly Signature[]>;
    getSymbolsOfParameterPropertyDeclaration(parameter: Node, parameterName: string): Promise<readonly Symbol[]>;
    getAwaitedType(type: Type): Promise<Type | undefined>;
    getNullableType(type: Type, flags: number): Promise<Type | undefined>;
    isNullableType(type: Type): Promise<boolean>;
    getElementTypeOfArrayType(type: Type): Promise<Type | undefined>;
    getIndexInfoOfType(type: Type, kind: number): Promise<IndexInfo | undefined>;
    getIndexTypeOfType(type: Type, kind: number): Promise<Type | undefined>;
    getTypeOfPropertyOfType(type: Type, name: string): Promise<Type | undefined>;
    getTypeOfPropertyOfContextualType(type: Type, name: string): Promise<Type | undefined>;
    fillMissingTypeArguments(typeArguments: readonly Type[], typeParameters: readonly Type[] | undefined, minTypeArgumentCount: number, isJavaScriptImplicitAny: boolean): Promise<Type[]>;
    getWidenedLiteralType(type: Type): Promise<Type | undefined>;
    getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): Promise<Symbol[]>;
    isEmptyAnonymousObjectType(type: Type): Promise<boolean>;
    isLibType(type: Type): Promise<boolean>;
    symbolIsValue(symbol: Symbol): Promise<boolean>;
    requiresAddingImplicitUndefined(node: Node): Promise<boolean>;
    getTypeOnlyAliasDeclaration(symbol: Symbol): Promise<NodeHandle | undefined>;
    resolveExternalModuleName(moduleSpecifier: Node): Promise<Symbol | undefined>;
    getPropertySymbolOfDestructuringAssignment(location: Node): Promise<Symbol | undefined>;
    getSuggestedSymbolForNonexistentProperty(name: Node, containingType: Type): Promise<Symbol | undefined>;
    getSuggestedSymbolForNonexistentClassMember(name: string, baseType: Type): Promise<Symbol | undefined>;
    getSuggestedSymbolForNonexistentJSXAttribute(name: string, containingType: Type): Promise<Symbol | undefined>;
    getSuggestedSymbolForNonexistentModule(name: Node, targetModule: Symbol): Promise<Symbol | undefined>;
    getSuggestedSymbolForNonexistentSymbol(location: Node, name: string, meaning: number): Promise<Symbol | undefined>;
    symbolToExpression(symbol: Symbol, meaning: number, enclosingDeclaration?: Node, flags?: number, internalFlags?: number): Promise<Node | undefined>;
    symbolToNode(symbol: Symbol, meaning: number, enclosingDeclaration?: Node, flags?: number, internalFlags?: number): Promise<Node | undefined>;
    symbolToEntityName(symbol: Symbol, meaning: number, enclosingDeclaration?: Node, flags?: number, internalFlags?: number): Promise<Node | undefined>;
    typePredicateToTypePredicateNode(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: number): Promise<Node | undefined>;
    indexInfoToIndexSignatureDeclaration(info: IndexInfo, enclosingDeclaration?: Node, flags?: number): Promise<Node | undefined>;
    getExactOptionalProperties(type: Type): Promise<readonly Symbol[]>;
    getJsxNamespace(location?: Node): Promise<string>;
    getJsxFragmentFactory(location: Node): Promise<string>;
    getParameterIdentifierInfoAtPosition(signature: Signature, position: number): Promise<{
        parameter: NodeHandle;
        parameterName: string;
        isRestParameter: boolean;
    } | undefined>;
    createArrayType(elementType: Type): Promise<Type | undefined>;
    createPromiseType(promisedType: Type): Promise<Type | undefined>;
    createTransientSymbolWithType(flags: number, name: string, type?: Type): Promise<Symbol>;
    createSignatureFromParts(parameters: readonly Symbol[], returnType: Type, minArgumentCount: number, flags: number, typeParameters?: readonly Type[], thisParameter?: Symbol): Promise<Signature>;
    createAnonymousTypeFromParts(symbol: Symbol | undefined, members: readonly Symbol[], callSignatures: readonly Signature[], constructSignatures: readonly Signature[], indexInfos: readonly {
        keyType: Type;
        valueType: Type;
        isReadonly: boolean;
    }[]): Promise<Type | undefined>;
    getMemberOverrideModifierStatus(classLike: Node, symbol: Symbol, memberHasOverride: boolean, memberHasAbstract: boolean, memberIsStatic: boolean, memberHasName: boolean): Promise<number>;
    getSymbolOfExpando(location: Node, allowDeclaration: boolean): Promise<Symbol | undefined>;
    collectVisitedTypeParameters(type: Type): Promise<Type[]>;
    isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: number, shouldComputeAliasesToMakeVisible: boolean): Promise<{
        accessibility: number;
        errorSymbolName?: string;
        errorModuleName?: string;
    }>;
    getIndexInfosOfIndexSymbol(indexSymbol: Symbol, siblingSymbols?: readonly Symbol[]): Promise<IndexInfo[]>;
    containsArgumentsReference(node: Node): Promise<boolean>;
    getAugmentedPropertiesOfType(type: Type): Promise<readonly Symbol[]>;
    getReturnTypeOfSignature(signature: Signature): Promise<Type | undefined>;
    getRestTypeOfSignature(signature: Signature): Promise<Type | undefined>;
    getTypePredicateOfSignature(signature: Signature): Promise<TypePredicate | undefined>;
    /**
     * Get the base types of a class or interface type. A type with no base types
     * yields an empty array.
     */
    getBaseTypes(type: InterfaceType): Promise<readonly Type[]>;
    getApparentType(type: Type): Promise<Type | undefined>;
    getPropertiesOfType(type: Type): Promise<readonly Symbol[]>;
    getIndexInfosOfType(type: Type): Promise<readonly IndexInfo[]>;
    /**
     * Index infos applicable at a property-access name (stock getIndexInfosAtLocation).
     * Non-PA-name → undefined; PA-name with no matches → [].
     */
    getIndexInfosAtLocation(node: Node): Promise<readonly IndexInfo[] | undefined>;
    /** Attach declaration.symbol from wire (RemoteNode AST omits binder symbols). */
    private materializeIndexInfo;
    /**
     * Get the constraint of a type parameter (the `T` in `<U extends T>`), or
     * undefined if it has none.
     */
    getConstraintOfTypeParameter(type: TypeParameter): Promise<Type | undefined>;
    getBaseConstraintOfType(type: Type): Promise<Type | undefined>;
    getPropertyOfType(type: Type, name: string): Promise<Symbol | undefined>;
    getConstantValue(node: Node): Promise<string | number | undefined>;
    getSignatureFromDeclaration(node: Node): Promise<Signature | undefined>;
    getExportSpecifierLocalTargetSymbol(node: Node): Promise<Symbol | undefined>;
    /**
     * Follow all aliases to get the original symbol. Always returns a symbol; for
     * an unresolved alias the checker yields the unknown symbol (use
     * {@link Checker.isUnknownSymbol} to detect it).
     */
    getAliasedSymbol(symbol: Symbol): Promise<Symbol>;
    getImmediateAliasedSymbol(symbol: Symbol): Promise<Symbol | undefined>;
    /**
     * Fetch (once, then cache) the handle ids of the per-checker singleton
     * symbols (unknown, undefined, arguments). These ids are stable for the life
     * of the project's checker, so identity checks against them are local after
     * the first call.
     */
    private getWellKnownSymbols;
    /**
     * Returns `true` if the symbol is the checker's "unknown" symbol (e.g. the
     * result of {@link Checker.getAliasedSymbol} on an unresolved alias).
     */
    isUnknownSymbol(symbol: Symbol): Promise<boolean>;
    /**
     * Returns `true` if the symbol is the checker's "undefined" symbol.
     */
    isUndefinedSymbol(symbol: Symbol): Promise<boolean>;
    /**
     * Returns `true` if the symbol is the checker's "arguments" symbol.
     */
    isArgumentsSymbol(symbol: Symbol): Promise<boolean>;
    getExportsOfModule(symbol: Symbol): Promise<readonly Symbol[]>;
    getRootSymbols(symbol: Symbol): Promise<readonly Symbol[]>;
    getMemberInModuleExports(symbol: Symbol, name: string): Promise<Symbol | undefined>;
    resolveExternalModuleSymbol(symbol: Symbol): Promise<Symbol | undefined>;
    getJsDocTagsOfSymbol(symbol: Symbol): Promise<readonly JSDocTagInfo[]>;
    getDocumentationCommentOfSymbol(symbol: Symbol): Promise<string>;
    /**
     * Get the type arguments of a type reference (e.g. the `string` in `Array<string>`).
     */
    getTypeArguments(type: TypeReference): Promise<readonly Type[]>;
}
/** Materialized result of Checker.getPropertiesForObjectExpression. */
export interface ObjectExpressionCompletionInfo {
    members: {
        type: Type;
        promisedType: Type | undefined;
    }[];
    promiseFilteredType: Type;
    mergedType: Type | undefined;
    finalMembers: {
        type: Type;
        isArrayLike: boolean;
        invalidDueToUnionDiscriminant: boolean;
        hasCallOrConstructSignatures: boolean;
        apparentProperties: readonly Symbol[] | undefined;
    }[];
    /** Final union members surviving the stock filter, in union order. */
    filteredTypes: Type[];
    properties: readonly Symbol[];
}
export interface PrintNodeOptions {
    preserveSourceNewlines?: boolean | undefined;
    neverAsciiEscape?: boolean | undefined;
    terminateUnterminatedLiterals?: boolean | undefined;
}
export declare class Emitter {
    private client;
    constructor(client: Client);
    printNode(node: Node, options?: PrintNodeOptions): Promise<string>;
}
export declare class NodeHandle {
    /**
     * The project this handle was produced in, used as the default for {@link resolve}.
     * Node handles are only meaningful within a project's program, so the producing project
     * is remembered so callers don't have to pass it explicitly.
     */
    private readonly canonicalProject;
    readonly index: number;
    readonly kind: SyntaxKind;
    readonly path: Path;
    constructor(handle: string, canonicalProject: Project);
    /**
     * Resolve this handle to the actual AST node by fetching the source file from a project
     * and looking up the node by index. If no project is passed, the project that produced
     * the handle is used.
     */
    resolve(project?: Project): Promise<Node | undefined>;
}
/** A symbol definition paired with all of its reference nodes. */
export interface ReferencedSymbolEntry {
    /** The node handle for the symbol's definition. */
    definition: NodeHandle;
    /** The resolved symbol for the definition, if available. */
    symbol?: Symbol | undefined;
    /** The node handles for each reference to the symbol. */
    references: NodeHandle[];
}
/** A single usage of a signature, pairing the reference name with its call expression (if any). */
export interface SignatureUsage {
    /** The node handle for the name reference. */
    name: NodeHandle;
    /** The node handle for the call expression, if the reference is invoked. */
    call?: NodeHandle | undefined;
}
export declare class Symbol {
    private objectRegistry;
    /**
     * The project this symbol was first observed in, used as the default project for
     * lookups that need a project context (members/exports/parent). Symbols are shared
     * snapshot-wide, so these lookups can otherwise be ambiguous about which project to use.
     */
    private readonly canonicalProject;
    readonly id: number;
    /** The escaped (`__String`) name, used as the key in member/export tables. */
    readonly escapedName: __String;
    /** The display name (escaped underscores removed). */
    readonly name: string;
    readonly flags: SymbolFlags;
    readonly checkFlags: number;
    readonly declarations: readonly NodeHandle[];
    readonly valueDeclaration: NodeHandle | undefined;
    private readonly parent;
    private readonly exportSymbol;
    private membersCache;
    private exportsCache;
    constructor(data: SymbolResponse, objectRegistry: SnapshotObjectRegistry);
    getParent(): Promise<Symbol | undefined>;
    /**
     * Get this symbol's members keyed by escaped name. The result is cached on
     * the symbol, so repeated calls do not round-trip to the server.
     */
    getMembers(): Promise<ReadonlyMap<__String, Symbol>>;
    /**
     * Get this symbol's exports keyed by escaped name. The result is cached on
     * the symbol, so repeated calls do not round-trip to the server.
     */
    getExports(): Promise<ReadonlyMap<__String, Symbol>>;
    private fetchSymbolTable;
    getExportSymbol(): Promise<Symbol>;
    getJsDocTags(checker: Checker): Promise<readonly JSDocTagInfo[]>;
    getDocumentationComment(checker: Checker): Promise<string>;
}
declare class TypeObject implements Type {
    private objectRegistry;
    readonly id: number;
    readonly flags: TypeFlags;
    readonly objectFlags: ObjectFlags;
    private symbolHandle;
    readonly value: string | number | boolean | bigint;
    readonly intrinsicName: string;
    readonly isThisType: boolean;
    readonly freshType: number;
    readonly regularType: number;
    readonly target: number;
    readonly typeParameters: readonly number[];
    readonly outerTypeParameters: readonly number[];
    readonly localTypeParameters: readonly number[];
    readonly aliasTypeArguments: readonly number[];
    readonly aliasSymbol: number;
    readonly elementFlags: readonly ElementFlags[];
    readonly fixedLength: number;
    readonly readonly: boolean;
    readonly texts: readonly string[];
    readonly objectType: number;
    readonly indexType: number;
    readonly checkType: number;
    readonly extendsType: number;
    readonly baseType: number;
    readonly substConstraint: number;
    private trueType;
    private falseType;
    constructor(data: TypeResponse, objectRegistry: ProjectObjectRegistry);
    getSymbol(): Promise<Symbol | undefined>;
    getAliasSymbol(): Promise<Symbol | undefined>;
    getTarget(): Promise<Type>;
    getFreshType(): Promise<FreshableType | undefined>;
    getRegularType(): Promise<FreshableType | undefined>;
    getTypes(): Promise<readonly Type[] | undefined>;
    getTypeParameters(): Promise<readonly TypeParameter[]>;
    getOuterTypeParameters(): Promise<readonly TypeParameter[]>;
    getLocalTypeParameters(): Promise<readonly TypeParameter[]>;
    getAliasTypeArguments(): Promise<readonly Type[]>;
    getObjectType(): Promise<Type>;
    getIndexType(): Promise<Type>;
    getCheckType(): Promise<Type>;
    getExtendsType(): Promise<Type>;
    getBaseType(): Promise<Type>;
    getConstraint(): Promise<Type>;
    getTrueType(): Promise<Type>;
    getFalseType(): Promise<Type>;
    /**
     * Get the base types of this type. Returns `undefined` for any type that is
     * not a class or interface.
     */
    getBaseTypes(): Promise<readonly Type[] | undefined>;
    isClassOrInterface(): this is InterfaceType;
    isUnionType(): this is UnionType;
    isIntersectionType(): this is IntersectionType;
    isObjectType(): this is ObjectType;
    isIntrinsicType(): this is IntrinsicType;
    isErrorType(): boolean;
    isLiteralType(): this is LiteralType;
    isStringLiteralType(): this is StringLiteralType;
    isNumberLiteralType(): this is NumberLiteralType;
    isBigIntLiteralType(): this is BigIntLiteralType;
    isBooleanLiteralType(): this is BooleanLiteralType;
    isTypeReference(): this is TypeReference;
    isTupleType(): this is TupleType;
    isIndexType(): this is IndexType;
    isIndexedAccessType(): this is IndexedAccessType;
    isConditionalType(): this is ConditionalType;
    isSubstitutionType(): this is SubstitutionType;
    isTemplateLiteralType(): this is TemplateLiteralType;
    isStringMappingType(): this is StringMappingType;
    isTypeParameter(): this is TypeParameter;
}
export declare function isUnionType(type: Type): type is UnionType;
export declare function isIntersectionType(type: Type): type is IntersectionType;
export declare function isObjectType(type: Type): type is ObjectType;
export declare function isClassOrInterfaceType(type: Type): type is InterfaceType;
export declare function isIntrinsicType(type: Type): type is IntrinsicType;
/**
 * Whether this is the error type — the placeholder the checker produces when a
 * type cannot be determined (e.g. an unresolved reference). It is an intrinsic
 * type named `"error"` (this covers both the singleton error type and the
 * per-alias error types manufactured for unresolved type alias references).
 */
export declare function isErrorType(type: Type): boolean;
export declare function isLiteralType(type: Type): type is LiteralType;
export declare function isStringLiteralType(type: Type): type is StringLiteralType;
export declare function isNumberLiteralType(type: Type): type is NumberLiteralType;
export declare function isBigIntLiteralType(type: Type): type is BigIntLiteralType;
export declare function isBooleanLiteralType(type: Type): type is BooleanLiteralType;
export declare function isTypeReference(type: Type): type is TypeReference;
export declare function isTupleType(type: Type): type is TupleType;
export declare function isIndexType(type: Type): type is IndexType;
export declare function isIndexedAccessType(type: Type): type is IndexedAccessType;
export declare function isConditionalType(type: Type): type is ConditionalType;
export declare function isSubstitutionType(type: Type): type is SubstitutionType;
export declare function isTemplateLiteralType(type: Type): type is TemplateLiteralType;
export declare function isStringMappingType(type: Type): type is StringMappingType;
export declare function isTypeParameter(type: Type): type is TypeParameter;
export declare class Signature {
    private flags;
    private objectRegistry;
    readonly id: number;
    readonly declaration?: NodeHandle | undefined;
    private readonly typeParameterHandles;
    private readonly _parameterIds;
    private readonly thisParameterHandle;
    private readonly targetHandle;
    constructor(data: SignatureResponse, project: Project, objectRegistry: ProjectObjectRegistry);
    /** @deprecated Prefer getTypeParameters(); raw handles are no longer public. */
    get typeParameters(): readonly number[] | undefined;
    get parameters(): readonly number[];
    get thisParameter(): number | undefined;
    get target(): number | undefined;
    getTypeParameters(): Promise<readonly TypeParameter[] | undefined>;
    getParameters(): Promise<readonly Symbol[]>;
    getThisParameter(): Promise<Symbol | undefined>;
    getTarget(): Promise<Signature | undefined>;
    getTypeParameterAtPosition(pos: number): Promise<Type>;
    get hasRestParameter(): boolean;
    get isConstruct(): boolean;
    get isAbstract(): boolean;
}
//# sourceMappingURL=api.d.ts.map