import { type SourcePosition } from "@ark/fs"; import * as tsvfs from "@typescript/vfs"; import ts from "typescript"; export declare class TsServer { rootFiles: string[]; virtualEnv: tsvfs.VirtualTypeScriptEnvironment; program: ts.Program; private static _instance; static get instance(): TsServer; private tsConfigInfo; constructor(tsConfigInfo?: TsconfigInfo); getSourceFileOrThrow(path: string): ts.SourceFile; } export declare const nearestCallExpressionChild: (node: ts.Node, position: number) => ts.CallExpression; export declare const nearestBoundingCallExpression: (node: ts.Node, position: number) => ts.CallExpression | undefined; export declare const getAbsolutePosition: (file: ts.SourceFile, position: SourcePosition) => number; export type TsconfigInfo = { path: string | undefined; parsed: ts.ParsedCommandLine; }; export declare const getTsConfigInfoOrThrow: () => TsconfigInfo; type TsLibFiles = { defaultMapFromNodeModules: Map; resolvedPaths: string[]; }; export declare const getTsLibFiles: (tsconfigOptions: ts.CompilerOptions) => TsLibFiles; export declare const getProgram: (env?: tsvfs.VirtualTypeScriptEnvironment) => ts.Program; export interface InternalTypeChecker extends ts.TypeChecker { getInstantiationCount: () => number; isTypeAssignableTo: (source: ts.Type, target: ts.Type) => boolean; getDiagnostics: () => ts.Diagnostic[]; } export declare const getInternalTypeChecker: (env?: tsvfs.VirtualTypeScriptEnvironment) => InternalTypeChecker; export interface StringifiableType extends ts.Type { toString(): string; isUnresolvable: boolean; } export declare const getStringifiableType: (node: ts.Node) => StringifiableType; export type ArgumentTypes = { args: StringifiableType[]; typeArgs: StringifiableType[]; }; export declare const extractArgumentTypesFromCall: (call: ts.CallExpression) => ArgumentTypes; export declare const getDescendants: (node: ts.Node) => ts.Node[]; export declare const getAncestors: (node: ts.Node) => ts.Node[]; export declare const getFirstAncestorByKindOrThrow: (node: ts.Node, kind: ts.SyntaxKind) => ts.Node; export {};