/** * Symbol Table for Cross-File Resolution * * Tracks what each file exports (classes, methods, fields) and imports, * enabling resolution of cross-file references. */ import type { CircleIR, ImportInfo } from '../types/index.js'; /** * Exported symbol with full metadata */ export interface ExportedSymbol { name: string; fqn: string; kind: 'class' | 'interface' | 'enum' | 'method' | 'field'; file: string; line: number; visibility: 'public' | 'protected' | 'package' | 'private'; parentType?: string; signature?: string; } /** * SymbolTable - Tracks exports and imports across project files */ export declare class SymbolTable { private exports; private nameToFqns; private fileImports; private packageTypes; private fqnToFile; /** * Add exports and imports from a CircleIR analysis result */ addFromIR(ir: CircleIR, filePath: string): void; /** * Add type and its members as exports */ private addTypeExports; /** * Add a method as an export */ private addMethodExport; /** * Add a field as an export */ private addFieldExport; /** * Register an export in all indexes */ private registerExport; /** * Add imports for a file */ private addFileImports; /** * Add explicit export declaration */ private addExplicitExport; /** * Resolve a simple name to its FQN from a given file's context */ resolveSymbol(name: string, fromFile: string): ExportedSymbol | undefined; /** * Resolve a type name to FQN, considering imports */ resolveTypeName(name: string, fromFile: string): string | undefined; /** * Get all methods of a type by FQN */ getMethodsOfType(typeFqn: string): ExportedSymbol[]; /** * Find a method by name in a type */ findMethod(typeFqn: string, methodName: string): ExportedSymbol | undefined; /** * Get the file where a symbol is defined */ getFile(fqn: string): string | undefined; /** * Get all exported symbols from a file */ getFileExports(filePath: string): ExportedSymbol[]; /** * Get all types in a package */ getPackageTypes(packageName: string): string[]; /** * Get all known packages */ getPackages(): string[]; /** * Check if a symbol exists */ hasSymbol(fqn: string): boolean; /** * Get symbol by FQN */ getSymbol(fqn: string): ExportedSymbol | undefined; /** * Get all possible FQNs for a simple name */ getPossibleFqns(simpleName: string): string[]; /** * Get imports for a file */ getFileImports(filePath: string): ImportInfo[]; /** * Get statistics */ getStats(): { totalSymbols: number; types: number; methods: number; fields: number; files: number; packages: number; }; /** * Clear all data */ clear(): void; /** * Extract visibility from annotations (for types) */ private getVisibility; /** * Extract visibility from modifiers */ private getVisibilityFromModifiers; } /** * Build a symbol table from multiple IR results */ export declare function buildSymbolTable(files: Array<{ ir: CircleIR; path: string; }>): SymbolTable; //# sourceMappingURL=symbol-table.d.ts.map