import type { SyntaxNode } from 'tree-sitter'; import type { Definition } from './definition-extractor.js'; import type { WorkspaceMap } from './workspace-resolver.js'; export interface CallsiteMetadata { argumentCount: number; isMethodCall: boolean; isConstructorCall: boolean; receiverName?: string; } export interface SymbolUsage { position: { row: number; column: number; }; context: string; callsite?: CallsiteMetadata; } export interface ImportedSymbol { name: string; localName: string; kind: 'named' | 'default' | 'namespace' | 'side-effect'; usages: SymbolUsage[]; } export interface FileReference { type: 'import' | 'dynamic-import' | 'require' | 're-export' | 'export-all'; source: string; resolvedPath?: string; isExternal: boolean; isTypeOnly: boolean; imports: ImportedSymbol[]; position: { row: number; column: number; }; } /** * Resolve an import path to an absolute path if it exists in the known files set */ export declare function resolveImportPath(source: string, fromFile: string, knownFiles: Set, workspaceMap?: WorkspaceMap | null): string | undefined; /** * Find all usages of a symbol name in the AST */ export declare function findSymbolUsages(rootNode: SyntaxNode, symbolName: string): SymbolUsage[]; /** * Extract all references from an AST */ export declare function extractReferences(rootNode: SyntaxNode, filePath: string, knownFiles: Set, workspaceMap?: WorkspaceMap | null): FileReference[]; /** * Internal symbol usage - for tracking calls to local definitions within the same file */ export interface InternalSymbolUsage { definitionName: string; usages: SymbolUsage[]; } /** * Extract internal usages of definitions within the same file. * This captures calls to local functions, classes, etc. that are not imported. * @param includeTypeUsages - If true, also include type usages (not just call usages) */ export declare function extractInternalUsages(rootNode: SyntaxNode, definitions: Definition[], includeTypeUsages?: boolean): InternalSymbolUsage[]; /** * Extract type references from type alias declarations. * This captures dependencies like User in `type Foo = Omit`. */ export declare function extractTypeAliasReferences(rootNode: SyntaxNode): Array<{ typeName: string; referencedTypes: string[]; position: { row: number; column: number; }; }>; //# sourceMappingURL=reference-extractor.d.ts.map