/// <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, BuilderFileGraphEntry, FileDiagnosticsBatchEntry, FileIncludeReasonsForFileWire, ProgramResolutionInfoWire, AmbientModulesBatch, ModuleExportMapBatch, ModuleSpecifiersBatch, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, Diagnostic, EmitResult, 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): API<true>;
    private ensureInitialized;
    parseConfigFile(file: DocumentIdentifier): ConfigResponse;
    updateSnapshot(params?: FromLSP extends true ? LSPUpdateSnapshotParams : UpdateSnapshotParams): Snapshot;
    close(): 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(): TimingInfo;
    /** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
    resetTimingInfo(): void;
}
export declare class InternalAPI {
    private client;
    private ensureInitialized;
    /** @internal */
    constructor(client: Client, ensureInitialized: () => void);
    startCPUProfile(dir: string): void;
    stopCPUProfile(): string;
    saveHeapProfile(dir: string): 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): Project | undefined;
    [globalThis.Symbol.dispose](): void;
    dispose(): 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;
    /**
     * Fetch the full declaration payload for a symbol id (declarations +
     * valueDeclaration). Returns null if the symbol has no declarations. Used to
     * lazily upgrade light prefetch symbols; the registry is snapshot-scoped so
     * no project id is required.
     */
    fetchSymbolDeclarations(symbolId: number): SymbolResponse | null;
    /**
     * Materialize symbols the server referenced by bare id (getSymbolsInScope
     * dedup) but this registry has not seen. getSymbolsDeclarations resolves
     * ids against the server-side snapshot registry and returns full payloads.
     */
    materializeSymbols(symbolIds: readonly number[]): (Symbol | undefined)[];
    /**
     * Batch-resolve parents for symbols whose wire payload omitted the parent
     * handle ("unfilled"). One RPC replaces a lazy getParentOfSymbol per
     * symbol; a null entry is the same confirmed "no parent" the lazy path
     * memoizes.
     */
    fetchParentsOfSymbols(symbolIds: readonly number[]): (Symbol | undefined)[];
    /**
     * Batch-prefetch declaration payloads for every unresolved symbol in the
     * registry, WITHOUT resolving them. A single lazy `.declarations` miss
     * usually means a services loop is walking many light symbols
     * (auto-import/codefix export scans touch thousands); one batched RPC
     * replaces N per-symbol round trips. Payloads are stashed on each symbol
     * and applied only when that symbol's declarations are actually read, so
     * observable resolution state (hasDeclarationsResolved) stays identical
     * to the per-symbol lazy path — bridge-side remap gates branch on it.
     */
    stashAllUnresolvedDeclarations(): void;
    /** Batch-upgrade light prefetch symbols with declaration payloads (one RPC). */
    hydrateSymbolDeclarations(symbolIds: readonly number[]): void;
    fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined, projectId?: string): Symbol;
    fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[], projectId?: Path): readonly Symbol[];
}
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;
    materializeSymbols(symbolIds: readonly number[]): (Symbol | undefined)[];
    fetchParentsOfSymbols(symbolIds: readonly number[]): (Symbol | undefined)[];
    hydrateSymbolDeclarations(symbolIds: readonly number[]): void;
    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): T;
    fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined): Symbol;
    fetchSignature(source: Symbol | Signature | Type, method: string, handle: number | undefined): Signature;
    fetchTypes(source: Symbol | Signature | Type, method: string, handles?: readonly number[]): readonly Type[];
    fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[]): readonly Symbol[];
    fetchBaseTypes(source: Type): readonly Type[];
    /** Stock SignatureObject.getTypeParameterAtPosition → checker.getParameterType. */
    getParameterType(signature: Signature, index: number): 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): SourceFile | undefined;
    getSourceFileNames(): 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): 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): 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): 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): 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(): readonly BuilderFileGraphEntry[];
    /**
     * Paths referenced during program creation but not found on disk; the JS
     * watch layer installs file watchers on them (stock
     * updateMissingFilePathsWatch).
     */
    getMissingFilePaths(): readonly string[];
    /**
     * Stock-shaped include reasons for every program file (tsc --explainFiles,
     * find-all-references on non-module files, module-specifier reuse).
     */
    getFileIncludeReasons(): readonly FileIncludeReasonsForFileWire[];
    /**
     * The program's full resolution state: per-file module and
     * type-reference-directive caches plus automatic type directive
     * resolutions. The JS thin program lazily materializes stock's
     * resolvedModules / resolvedTypeReferenceDirectiveNames /
     * automaticTypeDirectiveResolutions from this one payload.
     */
    getProgramResolutionInfo(): ProgramResolutionInfoWire;
    /**
     * Union of every program file's binder-collected classifiable names —
     * stock Program.getClassifiableNames, the v1 semantic classifier's
     * identifier pre-filter.
     */
    getClassifiableNames(): readonly string[];
    /**
     * Stock's program-level tristate for node:-prefixed core-module
     * specifiers (auto-import specifier style). null is stock's undefined.
     */
    getUsesUriStyleNodeCoreModules(): boolean | null;
    /**
     * Per-file syntactic + semantic diagnostics for every program file in one
     * batch. Same per-file results as getSyntacticDiagnostics /
     * getSemanticDiagnostics called file-by-file; build-mode builders use this
     * to avoid ~2 RPCs per program file.
     */
    getDiagnosticsBatch(): readonly FileDiagnosticsBatchEntry[];
    /**
     * 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): 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): 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): readonly Diagnostic[];
    /**
     * Emit JS/declaration output for a file (or the whole program). Output files
     * are returned for the caller to write, so --noEmit and custom writeFile hosts
     * stay in control. `emitOnly`: 0=All, 1=Js, 2=Dts, 3=ForcedDts.
     */
    emit(options?: {
        file?: DocumentIdentifier;
        emitOnly?: number;
        forceDtsEmit?: boolean;
    }): EmitResult;
    /**
     * Emit only the .tsbuildinfo for this project. The serialized buildinfo is
     * returned in `outputFiles` for the caller to write (same contract as
     * {@link emit}); like stock Program.emitBuildInfo, the write happens
     * whenever the project has a buildinfo path — the caller owns the
     * emit-pending decision. Pass `build: true` when running under a
     * `tsc -b`-style solution build so non-incremental projects get
     * build-mode buildinfo (the flag never appears in the tsconfig itself).
     */
    emitBuildInfo(options?: {
        build?: boolean;
    }): EmitResult;
    /**
     * 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): 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): readonly Diagnostic[];
    /**
     * Get program-wide diagnostics for the project, including compiler options diagnostics.
     */
    getProgramDiagnostics(): readonly Diagnostic[];
    /**
     * Get global (non-file-specific) semantic diagnostics for the project.
     */
    getGlobalDiagnostics(): readonly Diagnostic[];
    /**
     * Get config file parsing diagnostics for the project.
     */
    getConfigFileParsingDiagnostics(): readonly Diagnostic[];
    /** Effective compiler options for a file (project-reference redirect aware). */
    getCompilerOptionsForFile(file: DocumentIdentifier): any;
    getImpliedNodeFormatForEmit(file: DocumentIdentifier): number | undefined;
    getDefaultResolutionModeForFile(file: DocumentIdentifier): number | undefined;
    getEmitModuleFormatOfFile(file: DocumentIdentifier): number;
    getModeForUsageLocation(file: DocumentIdentifier, position: number): number | undefined;
    getEmitSyntaxForUsageLocation(file: DocumentIdentifier, position: number): number | undefined;
    getRedirectTargets(file: DocumentIdentifier): readonly string[];
}
export declare class Checker {
    private snapshotId;
    private project;
    private client;
    private objectRegistry;
    private wellKnownSymbols;
    private memoBaseConstraintOfType;
    private memoBaseTypeOfLiteralType;
    private memoApparentType;
    private memoIsArrayType;
    private memoIsTupleType;
    private memoTypeArguments;
    private memoTypeKeyed;
    constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
    dispose(): void;
    /**
     * Lightweight ambient-module index (module names + symbols only — no exports).
     * Symbols are registered in the object registry as light prefetch entries.
     */
    getAmbientModules(): AmbientModulesBatch;
    /**
     * Auto-import export index for every external/ambient module in one batch,
     * mirroring stock exportInfoMap populate. Symbols are registered in the
     * object registry as light prefetch entries (declarations fetched lazily).
     */
    getModuleExportMap(): ModuleExportMapBatch;
    /**
     * Batch-resolve auto-import module specifiers for many module symbols in
     * one RPC, mirroring stock getModuleSpecifiersWithCacheInfo.
     */
    getModuleSpecifiersBatch(file: DocumentIdentifier, moduleSymbols: readonly Symbol[] | undefined, preferences?: {
        importModuleSpecifierPreference?: string;
        importModuleSpecifierEnding?: string;
        autoImportSpecifierExcludeRegexes?: readonly string[];
    }): ModuleSpecifiersBatch;
    getSymbolAtLocation(node: Node): Symbol | undefined;
    getSymbolAtLocation(nodes: readonly Node[]): (Symbol | undefined)[];
    getSymbolAtPosition(file: DocumentIdentifier, position: number): Symbol | undefined;
    getSymbolAtPosition(file: DocumentIdentifier, positions: readonly number[]): (Symbol | undefined)[];
    getTypeOfSymbol(symbol: Symbol): Type | undefined;
    getTypeOfSymbol(symbols: readonly Symbol[]): (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): Type;
    getReferencesToSymbolInFile(file: DocumentIdentifier, symbol: Symbol): NodeHandle[];
    getReferencedSymbolsForNode(node: Node, position: number): ReferencedSymbolEntry[];
    getSignatureUsage(signatureDecl: Node): SignatureUsage[];
    getCompletionsAtPosition(document: string, position: number, options?: CompletionOptions): CompletionInfo | undefined;
    getTypeAtLocation(node: Node): Type | undefined;
    getTypeAtLocation(nodes: readonly Node[]): (Type | undefined)[];
    getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
    getResolvedSignature(node: Node): Signature | undefined;
    /**
     * Signature-help resolution (CheckMode.IsForSignatureHelp + cache clear).
     * Returns {resolved, candidates}; argumentCount undefined → sentinel -1.
     */
    getResolvedSignatureForSignatureHelp(node: Node, argumentCount?: number): {
        resolved: Signature | undefined;
        candidates: Signature[];
    };
    getExpandedParameters(signature: Signature, skipUnionExpanding?: boolean): readonly (readonly Symbol[])[];
    hasEffectiveRestParameter(signature: Signature): boolean;
    symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: number): Node | undefined;
    getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol: Symbol): readonly Type[] | undefined;
    getContextualTypeForObjectLiteralElement(element: Node, contextFlags?: number): Type | undefined;
    isOptionalParameter(node: Node): boolean;
    isImplementationOfOverload(node: Node): boolean;
    getTypeAtPosition(file: DocumentIdentifier, position: number): Type | undefined;
    getTypeAtPosition(file: DocumentIdentifier, positions: readonly number[]): (Type | undefined)[];
    getSymbolsInScope(location: Node, meaning: SymbolFlags): readonly Symbol[];
    resolveName(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Symbol | undefined;
    getResolvedSymbol(node: Identifier): Symbol | undefined;
    getContextualType(node: Expression, contextFlags?: number): Type | undefined;
    getBaseTypeOfLiteralType(type: Type): Type | undefined;
    getNonNullableType(type: Type): Type | undefined;
    getNonOptionalType(type: Type): Type | undefined;
    getTypeFromTypeNode(node: TypeNode): Type | undefined;
    getWidenedType(type: Type): Type | undefined;
    getParameterType(signature: Signature, index: number): Type | undefined;
    isArrayLikeType(type: Type): boolean;
    isTypeAssignableTo(source: Type, target: Type): boolean;
    getUnionType(types: readonly Type[], unionReduction?: number): Type | undefined;
    getPromisedTypeOfPromise(type: Type): Type | undefined;
    getAllPossiblePropertiesOfTypes(types: readonly Type[]): readonly Symbol[];
    isTypeInvalidDueToUnionDiscriminant(type: Type, node: Node): boolean;
    typeHasCallOrConstructSignatures(type: Type): 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): ObjectExpressionCompletionInfo | undefined;
    getShorthandAssignmentValueSymbol(node: Node): 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): Type;
    private getIntrinsicType;
    getAnyType(): Type;
    getErrorType(): Type;
    getPromiseType(): Type;
    getPromiseLikeType(): Type;
    getAnyAsyncIterableType(): Type | undefined;
    getStringType(): Type;
    getNumberType(): Type;
    getBooleanType(): Type;
    getVoidType(): Type;
    getUndefinedType(): Type;
    getNullType(): Type;
    getNeverType(): Type;
    getUnknownType(): Type;
    getBigIntType(): Type;
    getESSymbolType(): Type;
    getOptionalType(): Type;
    getNonPrimitiveType(): Type;
    getStringLiteralType(value: string): Type;
    getNumberLiteralType(value: number): Type;
    getBigIntLiteralType(value: {
        negative: boolean;
        base10Value: string;
    }): Type;
    getDefaultFromTypeParameter(type: Type): Type | undefined;
    getTypeOfAssignmentPattern(pattern: Node): Type | undefined;
    getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined;
    getRecursionIdentity(type: Type): string;
    getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined;
    typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: number): TypeNode | undefined;
    typeParameterToDeclaration(type: Type, enclosingDeclaration?: Node, flags?: number): Node | undefined;
    symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration?: Node, flags?: number): Node[];
    signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Node | undefined;
    signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: number): string;
    typeToString(type: Type, enclosingDeclaration?: Node, flags?: number): string;
    isContextSensitive(node: Node): boolean;
    isArrayType(type: Type): boolean;
    isTupleType(type: Type): boolean;
    isDeclarationVisible(node: Node): boolean;
    tryGetThisTypeAt(node: Node, includeGlobalThis?: boolean, container?: Node): Type | undefined;
    isValidPropertyAccessForCompletions(node: Node, type: Type, property: Symbol): boolean;
    getTypeArgumentConstraint(node: Node): Type | undefined;
    getExportsAndPropertiesOfModule(moduleSymbol: Symbol): readonly Symbol[];
    getJsxIntrinsicTagNamesAt(location: Node): readonly Symbol[];
    isPropertyAccessible(node: Node, isSuper: boolean, isWrite: boolean, containingType: Type, property: Symbol): boolean;
    getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: number, useOnlyExternalAliasing: boolean): readonly Symbol[] | undefined;
    getContextualTypeForArgumentAtIndex(callTarget: Node, argIndex: number): Type | undefined;
    getContextualTypeForJsxAttribute(attribute: Node): Type | undefined;
    isValidPropertyAccess(node: Node, propertyName: string): boolean;
    getCandidateSignaturesForStringLiteralCompletions(call: Node, editingArgument: Node): readonly Signature[];
    getSymbolsOfParameterPropertyDeclaration(parameter: Node, parameterName: string): readonly Symbol[];
    getAwaitedType(type: Type): Type | undefined;
    getNullableType(type: Type, flags: number): Type | undefined;
    isNullableType(type: Type): boolean;
    getElementTypeOfArrayType(type: Type): Type | undefined;
    getIndexInfoOfType(type: Type, kind: number): IndexInfo | undefined;
    getIndexTypeOfType(type: Type, kind: number): Type | undefined;
    getTypeOfPropertyOfType(type: Type, name: string): Type | undefined;
    getTypeOfPropertyOfContextualType(type: Type, name: string): Type | undefined;
    fillMissingTypeArguments(typeArguments: readonly Type[], typeParameters: readonly Type[] | undefined, minTypeArgumentCount: number, isJavaScriptImplicitAny: boolean): Type[];
    getWidenedLiteralType(type: Type): Type | undefined;
    getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): Symbol[];
    isEmptyAnonymousObjectType(type: Type): boolean;
    isLibType(type: Type): boolean;
    symbolIsValue(symbol: Symbol): boolean;
    requiresAddingImplicitUndefined(node: Node): boolean;
    getTypeOnlyAliasDeclaration(symbol: Symbol): NodeHandle | undefined;
    resolveExternalModuleName(moduleSpecifier: Node): Symbol | undefined;
    getPropertySymbolOfDestructuringAssignment(location: Node): Symbol | undefined;
    getSuggestedSymbolForNonexistentProperty(name: Node, containingType: Type): Symbol | undefined;
    getSuggestedSymbolForNonexistentClassMember(name: string, baseType: Type): Symbol | undefined;
    getSuggestedSymbolForNonexistentJSXAttribute(name: string, containingType: Type): Symbol | undefined;
    getSuggestedSymbolForNonexistentModule(name: Node, targetModule: Symbol): Symbol | undefined;
    getSuggestedSymbolForNonexistentSymbol(location: Node, name: string, meaning: number): Symbol | undefined;
    symbolToExpression(symbol: Symbol, meaning: number, enclosingDeclaration?: Node, flags?: number, internalFlags?: number): Node | undefined;
    symbolToNode(symbol: Symbol, meaning: number, enclosingDeclaration?: Node, flags?: number, internalFlags?: number): Node | undefined;
    symbolToEntityName(symbol: Symbol, meaning: number, enclosingDeclaration?: Node, flags?: number, internalFlags?: number): Node | undefined;
    typePredicateToTypePredicateNode(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: number): Node | undefined;
    indexInfoToIndexSignatureDeclaration(info: IndexInfo, enclosingDeclaration?: Node, flags?: number): Node | undefined;
    getExactOptionalProperties(type: Type): readonly Symbol[];
    getJsxNamespace(location?: Node): string;
    getJsxFragmentFactory(location: Node): string;
    getParameterIdentifierInfoAtPosition(signature: Signature, position: number): {
        parameter: NodeHandle;
        parameterName: string;
        isRestParameter: boolean;
    } | undefined;
    createArrayType(elementType: Type): Type | undefined;
    createPromiseType(promisedType: Type): Type | undefined;
    createTransientSymbolWithType(flags: number, name: string, type?: Type): Symbol;
    createSignatureFromParts(parameters: readonly Symbol[], returnType: Type, minArgumentCount: number, flags: number, typeParameters?: readonly Type[], thisParameter?: Symbol): Signature;
    createAnonymousTypeFromParts(symbol: Symbol | undefined, members: readonly Symbol[], callSignatures: readonly Signature[], constructSignatures: readonly Signature[], indexInfos: readonly {
        keyType: Type;
        valueType: Type;
        isReadonly: boolean;
    }[]): Type | undefined;
    getMemberOverrideModifierStatus(classLike: Node, symbol: Symbol, memberHasOverride: boolean, memberHasAbstract: boolean, memberIsStatic: boolean, memberHasName: boolean): number;
    getSymbolOfExpando(location: Node, allowDeclaration: boolean): Symbol | undefined;
    collectVisitedTypeParameters(type: Type): Type[];
    isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: number, shouldComputeAliasesToMakeVisible: boolean): {
        accessibility: number;
        errorSymbolName?: string;
        errorModuleName?: string;
    };
    getIndexInfosOfIndexSymbol(indexSymbol: Symbol, siblingSymbols?: readonly Symbol[]): IndexInfo[];
    containsArgumentsReference(node: Node): boolean;
    getAugmentedPropertiesOfType(type: Type): readonly Symbol[];
    getReturnTypeOfSignature(signature: Signature): Type | undefined;
    getRestTypeOfSignature(signature: Signature): Type | undefined;
    getTypePredicateOfSignature(signature: Signature): 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): readonly Type[];
    getApparentType(type: Type): Type | undefined;
    getPropertiesOfType(type: Type): readonly Symbol[];
    getIndexInfosOfType(type: Type): readonly IndexInfo[];
    /**
     * Index infos applicable at a property-access name (stock getIndexInfosAtLocation).
     * Non-PA-name → undefined; PA-name with no matches → [].
     */
    getIndexInfosAtLocation(node: Node): 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): Type | undefined;
    getBaseConstraintOfType(type: Type): Type | undefined;
    getPropertyOfType(type: Type, name: string): Symbol | undefined;
    getConstantValue(node: Node): string | number | undefined;
    getSignatureFromDeclaration(node: Node): Signature | undefined;
    getExportSpecifierLocalTargetSymbol(node: Node): 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): Symbol;
    getImmediateAliasedSymbol(symbol: Symbol): 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): boolean;
    /**
     * Returns `true` if the symbol is the checker's "undefined" symbol.
     */
    isUndefinedSymbol(symbol: Symbol): boolean;
    /**
     * Returns `true` if the symbol is the checker's "arguments" symbol.
     */
    isArgumentsSymbol(symbol: Symbol): boolean;
    getExportsOfModule(symbol: Symbol): readonly Symbol[];
    getModuleSymbolForSourceFile(file: DocumentIdentifier): Symbol | undefined;
    getRootSymbols(symbol: Symbol): readonly Symbol[];
    getMemberInModuleExports(symbol: Symbol, name: string): Symbol | undefined;
    resolveExternalModuleSymbol(symbol: Symbol): Symbol | undefined;
    getJsDocTagsOfSymbol(symbol: Symbol): readonly JSDocTagInfo[];
    getDocumentationCommentOfSymbol(symbol: Symbol): string;
    /**
     * Get the type arguments of a type reference (e.g. the `string` in `Array<string>`).
     */
    getTypeArguments(type: TypeReference): readonly Type[];
}
export interface PrintNodeOptions {
    preserveSourceNewlines?: boolean | undefined;
    neverAsciiEscape?: boolean | undefined;
    terminateUnterminatedLiterals?: boolean | undefined;
}
/** 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 declare class Emitter {
    private client;
    constructor(client: Client);
    printNode(node: Node, options?: PrintNodeOptions): string;
}
/**
 * Install a kind-remap function applied to every NodeHandle's `kind` at
 * construction. Pass `undefined` to clear. Idempotent.
 */
export declare function setNodeHandleKindRemap(remap: ((rawKind: number) => number) | undefined): void;
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): 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;
    /** Wire handle for the parent symbol; `.parent` resolves it lazily. */
    private parentHandle;
    readonly exportSymbol: number;
    private membersCache;
    private exportsCache;
    private _declarations;
    private _valueDeclaration;
    private _declarationsResolved;
    constructor(data: SymbolResponse, objectRegistry: SnapshotObjectRegistry);
    /** @internal Upgrade parent handle when a fuller SymbolResponse arrives. */
    applyParentHandle(parent: number | undefined): void;
    /**
     * Stock services read `.parent` as the owning Symbol object (e.g.
     * SymbolDisplay's "type parameter T in C<T>" / "Indexed.prop"). Resolve
     * the wire handle lazily; if the handle was omitted (light prefetch),
     * still call getParentOfSymbol via objectId.
     */
    get parent(): Symbol | undefined;
    private ensureDeclarations;
    /** @internal Payload prefetched by stashAllUnresolvedDeclarations; applied on first read. */
    private _declarationStash;
    /** @internal */
    hasDeclarationStash(): boolean;
    /** @internal Stash a batch-prefetched payload without marking resolution. */
    stashDeclarationPayload(data: SymbolResponse | null): void;
    /** @internal Used by batch hydrate after prefetch. */
    hasDeclarationsResolved(): boolean;
    /** @internal Apply full or empty declaration payload from RPC. */
    applyDeclarationPayload(data: SymbolResponse | null): void;
    get declarations(): readonly NodeHandle[] | undefined;
    get valueDeclaration(): NodeHandle | undefined;
    getParent(): 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(): 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(): ReadonlyMap<__String, Symbol>;
    private fetchSymbolTable;
    getExportSymbol(): Symbol;
    getJsDocTags(checker: Checker): readonly JSDocTagInfo[];
    getDocumentationComment(checker: Checker): 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);
    /**
     * Stock services read `.symbol` as a Symbol object (e.g. signatureHelp
     * type-arg items: typeParameter.symbol.getDocumentationComment). Resolve
     * the wire handle lazily (same pattern as Symbol.parent).
     */
    get symbol(): Symbol | undefined;
    getSymbol(): Symbol | undefined;
    getAliasSymbol(): Symbol | undefined;
    getTarget(): Type;
    getFreshType(): FreshableType | undefined;
    getRegularType(): FreshableType | undefined;
    getTypes(): readonly Type[] | undefined;
    getTypeParameters(): readonly TypeParameter[];
    getOuterTypeParameters(): readonly TypeParameter[];
    getLocalTypeParameters(): readonly TypeParameter[];
    getAliasTypeArguments(): readonly Type[];
    getObjectType(): Type;
    getIndexType(): Type;
    getCheckType(): Type;
    getExtendsType(): Type;
    getBaseType(): Type;
    getConstraint(): Type;
    getTrueType(): Type;
    getFalseType(): Type;
    /**
     * Get the base types of this type. Returns `undefined` for any type that is
     * not a class or interface.
     */
    getBaseTypes(): 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 _typeParameters;
    private readonly thisParameterHandle;
    private readonly targetHandle;
    private readonly _parameterIds;
    private _parameters;
    constructor(data: SignatureResponse, project: Project, objectRegistry: ProjectObjectRegistry);
    get parameters(): readonly Symbol[];
    /**
     * Stock services read `.typeParameters` as TypeParameter[] | undefined.
     * Resolve wire TypeIDs lazily through the registry (cached after first access).
     */
    get typeParameters(): readonly TypeParameter[] | undefined;
    /**
     * Stock services read `.thisParameter` as Symbol | undefined.
     */
    get thisParameter(): Symbol | undefined;
    /**
     * Stock services read `.target` as Signature | undefined.
     */
    get target(): Signature | undefined;
    getTypeParameters(): readonly TypeParameter[] | undefined;
    getParameters(): readonly Symbol[];
    getThisParameter(): Symbol | undefined;
    getTarget(): Signature | undefined;
    /** Stock SignatureObject: delegate to checker.getParameterType(this, pos). */
    getTypeParameterAtPosition(pos: number): Type;
    get hasRestParameter(): boolean;
    get isConstruct(): boolean;
    get isAbstract(): boolean;
}
//# sourceMappingURL=api.d.ts.map