import type { CodeSymbol, Reference, SymbolKind } from "../types.js";
/**
 * Find symbols with names similar to the requested ID. Used to recover from
 * hallucinated symbol IDs (telemetry shows 24-26% of get_symbol/get_symbols
 * calls return zero results). Extracts a name candidate from the requested
 * ID and returns up to `limit` symbols whose name matches case-insensitively.
 */
export declare function findSimilarSymbols(repo: string, requestedId: string, limit?: number): Promise<Array<{
    id: string;
    name: string;
    kind: string;
    file: string;
    start_line: number;
}>>;
/**
 * Retrieve a single symbol by ID with fresh source from disk.
 * When include_related is true (default), auto-prefetches:
 *  - children (for classes/interfaces) — saves follow-up get_symbols call
 *  - symbols in the same file that reference this symbol — saves find_references call
 */
export declare function getSymbol(repo: string, symbolId: string, options?: {
    include_related?: boolean;
}): Promise<{
    symbol: CodeSymbol;
    related?: CodeSymbol[];
} | null>;
/**
 * Retrieve multiple symbols by ID with fresh source from disk.
 * Groups reads by file to minimize disk I/O.
 */
export declare function getSymbols(repo: string, symbolIds: string[]): Promise<CodeSymbol[]>;
/**
 * Find references to a symbol name across indexed files.
 * Matches whole words only using word-boundary regex.
 */
/**
 * Batch find references for multiple symbols in one pass.
 * Reads each file once instead of N times — critical for large repos.
 */
export declare function findReferencesBatch(repo: string, symbolNames: string[], filePattern?: string): Promise<Record<string, Reference[]>>;
export declare function findReferences(repo: string, symbolName: string, filePattern?: string): Promise<Reference[]>;
/** Format references as compact string for MCP output. Groups by file to avoid repeating paths. */
export declare function formatRefsCompact(refs: Reference[]): string;
/** Format a CodeSymbol as compact text: header line + source. ~70% less tokens than JSON. */
export declare function formatSymbolCompact(sym: CodeSymbol): string;
/** Format multiple CodeSymbols as compact text, separated by blank lines. */
export declare function formatSymbolsCompact(syms: CodeSymbol[]): string;
/** Format ContextBundle as compact text. */
export declare function formatBundleCompact(bundle: {
    symbol: CodeSymbol;
    imports: string[];
    siblings: Array<{
        name: string;
        kind: string;
        start_line: number;
        end_line: number;
    }>;
    types_used: string[];
}): string;
/**
 * Search for a symbol by query and return it with full source.
 * Optionally includes references across the codebase.
 */
export declare function findAndShow(repo: string, query: string, includeRefs?: boolean): Promise<{
    symbol: CodeSymbol;
    references?: Reference[];
} | null>;
export interface ReactContext {
    /** Props type name extracted from the component's parameter type annotation */
    props_type: string | null;
    /** Source of the props interface/type declaration when found in the index (Tier 4 — Item 16) */
    props_interface_source: string | null;
    /** React hooks called inside this component (use*() patterns) */
    hooks_used: Array<{
        name: string;
        is_stdlib: boolean;
    }>;
    /** Child components rendered via JSX (<PascalCase>) */
    child_components: string[];
    /** Parent components that render this one via JSX */
    parent_components: string[];
    /** Detected wrapper pattern (memo, forwardRef, lazy) or null */
    wrapper: "memo" | "forwardRef" | "lazy" | null;
}
export interface ContextBundle {
    symbol: CodeSymbol;
    imports: string[];
    siblings: Array<{
        name: string;
        kind: SymbolKind;
        start_line: number;
        end_line: number;
    }>;
    types_used: string[];
    /** Only populated when symbol.kind === "component" */
    react_context?: ReactContext;
}
/**
 * Get a symbol with its file's imports and sibling symbols in one call.
 * Saves 2-3 round-trips vs get_symbol + search_text(imports) + get_file_outline.
 */
export declare function getContextBundle(repo: string, symbolName: string): Promise<ContextBundle | null>;
export interface DeadCodeCandidate {
    name: string;
    kind: SymbolKind;
    file: string;
    start_line: number;
    end_line: number;
    reason: string;
}
export interface DeadCodeResult {
    candidates: DeadCodeCandidate[];
    scanned_symbols: number;
    scanned_files: number;
    truncated?: boolean;
}
/**
 * Find potentially dead code: exported symbols with 0 references outside their own file.
 * Scans all indexed files for word-boundary matches of each exported symbol name.
 *
 * F14 fixes (2026-05-05):
 *   - Test files are now ALWAYS scanned for references regardless of
 *     `include_tests`. The flag now gates only candidate selection (whether
 *     test-internal exports can themselves be flagged dead). Symbols used
 *     only in tests are no longer false-positive dead.
 *   - Re-exports via `export * from './x'` and `export { Y } from './x'`
 *     now mark `./x` as live; previously the lack of textual mention in the
 *     barrel made every barrel-forwarded symbol look dead.
 *   - MAX_SCAN_FILES raised 2000 → 5000; truncation now surfaces in the
 *     `truncated` field so callers can react.
 */
export declare function findDeadCode(repo: string, options?: {
    file_pattern?: string | undefined;
    include_tests?: boolean | undefined;
}): Promise<DeadCodeResult>;
export interface UnusedImport {
    file: string;
    line: number;
    import_text: string;
    imported_name: string;
}
export interface UnusedImportsResult {
    unused: UnusedImport[];
    scanned_files: number;
    truncated?: boolean;
}
/**
 * Find imports whose imported names are never referenced in the file body.
 * Supports ES module named imports: import { A, B } from '...'
 */
export declare function findUnusedImports(repo: string, options?: {
    file_pattern?: string;
    include_tests?: boolean;
}): Promise<UnusedImportsResult>;
//# sourceMappingURL=symbol-tools.d.ts.map