/**
 * Import Resolver
 *
 * Resolves import paths to actual files and symbols.
 */
import { Language } from '../types';
import { UnresolvedRef, ResolvedRef, ResolutionContext, ImportMapping, ReExport } from './types';
export declare function isNixPathImportRef(ref: UnresolvedRef): boolean;
/** Drop the per-context memo tables (see ReferenceResolver.clearCaches). */
export declare function clearImportResolverMemos(context: ResolutionContext): void;
export declare function resolveImportPath(importPath: string, fromFile: string, language: Language, context: ResolutionContext): string | null;
/**
 * Check if an import is external (npm package, etc.)
 *
 * `context` is consulted for project-defined path aliases
 * (tsconfig/jsconfig `paths`). Without that check, custom prefixes
 * like `@components/*` would fail the bare-specifier heuristic and
 * be classified as external before alias resolution can run.
 */
export declare function isExternalImport(importPath: string, language: Language, context?: ResolutionContext): boolean;
/**
 * Clear the C/C++ include directory cache (call between indexing runs)
 */
export declare function clearCppIncludeDirCache(): void;
/**
 * Discover C/C++ include search directories for a project.
 *
 * Strategy:
 * 1. Look for compile_commands.json (Clang compilation database) in the
 *    project root and common build subdirectories. Parse -I and -isystem
 *    flags from compiler commands.
 * 2. If no compilation database is found, probe for common convention
 *    directories (include/, src/, lib/, api/) and top-level directories
 *    containing .h/.hpp files.
 *
 * Returns paths relative to projectRoot.
 */
export declare function loadCppIncludeDirs(projectRoot: string): string[];
/**
 * Is this reference a PHP include/require PATH (vs a namespace `use` symbol)?
 *
 * include/require emit a file path ("lib.php", "inc/db.php", "../x.php"),
 * whereas namespace use is an FQN (App\Foo\Bar) or a bare class symbol
 * (Closure). PHP identifiers contain neither '/' nor '.', so a slash or dot
 * marks a path-shaped include. Such references resolve to files only — never
 * to a same-named symbol — so callers must not fall back to the name-matcher.
 */
export declare function isPhpIncludePathRef(ref: UnresolvedRef): boolean;
/**
 * Is this a COBOL COPY / EXEC SQL INCLUDE copybook reference? These resolve
 * to files only (or stay unresolved for compiler-supplied members) — never
 * to a same-named symbol via the name-matcher.
 */
export declare function isCobolCopybookRef(ref: UnresolvedRef): boolean;
/**
 * Extract import mappings from a file
 */
export declare function extractImportMappings(_filePath: string, content: string, language: Language): ImportMapping[];
/**
 * Clear the import mapping cache (call between indexing runs)
 */
export declare function clearImportMappingCache(): void;
/**
 * Extract JS/TS re-export declarations from `content`.
 *
 * Recognised forms:
 *   export { foo } from './a';
 *   export { foo as bar } from './a';
 *   export * from './a';
 *   export * as ns from './a';   (treated as wildcard for chasing)
 *   export { default as Foo } from './a';
 *
 * The walker intentionally stays regex-based — the import-resolver
 * elsewhere in this file already chooses regex over a fresh
 * tree-sitter pass, and this function shares that trade-off. Errors
 * fall through silently; resolution simply skips the broken file.
 */
export declare function extractReExports(content: string, language: Language): ReExport[];
/**
 * Resolve a reference using import mappings
 */
/**
 * JVM (Java / Kotlin) imports use fully-qualified names (`import
 * com.example.foo.Bar`) decoupled from filenames, so the JS/Python
 * style filesystem path lookup misses them whenever the file isn't
 * named after its primary symbol (Kotlin `Utils.kt` exporting `Bar`,
 * top-level fns, extension fns). Resolve them through the
 * `qualifiedName` index instead — populated by the package_header /
 * package_declaration namespace wrappers in the extractor.
 */
export declare function resolveJvmImport(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * PHP scoped calls are encoded as "Alias.method" by both extractors. A use
 * mapping names a namespace, not a filesystem path, so resolve the receiver
 * through its localName and look up the method on that exact imported type.
 * undefined means this is not an imported static call; null means the import
 * owns the call but its method is unavailable, so name fallbacks must not guess.
 */
export declare function resolvePhpImportedStaticCall(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null | undefined;
/**
 * A JS/TS `imports` reference that names a module by path. It names a FILE, not
 * a symbol, so it skips the resolver's name-exists pre-filter — a CommonJS
 * `require('./x')` has no import node of that name to pass it.
 */
export declare function isJsPathImportRef(ref: UnresolvedRef): boolean;
/**
 * A PHP class name written with a namespace in it (#2256). `use App\Fields as
 * Field;` aliases a namespace, so `new Field\FirstName()`, `extends Field\Base`
 * and `Field\FirstName::make()` all name `App\Fields\FirstName`. PHP reads a
 * qualified name one way: a leading `\` makes it absolute; otherwise a first
 * segment a `use` imports is replaced by what it imports, and any other name is
 * relative to the current namespace. Both extractors emit the written name
 * verbatim, and with no `.` or `::` in it the pre-filter would drop it.
 * undefined means the ref is not a qualified class name (or names a method the
 * class inherits); null means it is but no single project class has that name
 * — it lives outside the project — so name fallbacks must not guess.
 */
export declare function resolvePhpQualifiedClassRef(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null | undefined;
export declare function resolveViaImport(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Is `name`, as used in `ref`'s file, bound by an import whose module lives
 * OUTSIDE the repository?
 *
 * When it is, no in-repo node can be the referent: the symbol is defined in a
 * third-party crate/package, and any same-named local symbol the name-matcher
 * finds is a coincidence. Rust `use std::error::Error;` + `impl Error for
 * MapperError {}` bound to a local `MapperError::Error` variant, and once
 * non-type kinds were filtered out it simply moved to an unrelated local
 * `type Error` alias — restricting kinds alone RELOCATES the false edge
 * instead of removing it, so locality has to be checked too.
 *
 * Answers only when it can be CERTAIN, because a false "yes" deletes a real
 * edge. Two languages qualify, each with an oracle that cannot be wrong:
 *
 *  - **Rust** — the `use` path is rooted at a standard-library crate
 *    (`std`/`core`/`alloc`/`proc_macro`), which by definition ships outside
 *    any repository. Deliberately NOT generalized to "the module path doesn't
 *    resolve to a file": a crate can re-export another workspace crate's
 *    modules (`pub use pupil_core::{ports, domain};`), so `crate::ports::X`
 *    has no `src/ports/` directory to walk yet is entirely in-repo — that
 *    generalization measured 13 real trait implementations deleted.
 *  - **ES modules** — `isExternalImport`, which already accounts for tsconfig
 *    path aliases and monorepo workspace packages.
 *
 * Everything else returns false and resolves exactly as before. JVM and Python
 * imports notably do NOT go through `resolveImportPath` (they have dedicated
 * FQN/module matchers), so there is no trustworthy oracle to consult here.
 */
export declare function isBoundToOutOfRepoImport(ref: UnresolvedRef, context: ResolutionContext): boolean;
//# sourceMappingURL=import-resolver.d.ts.map