/**
 * Name Matcher
 *
 * Handles symbol name matching for reference resolution.
 */
import { Language, Node } from '../types';
import { UnresolvedRef, ResolvedRef, ResolutionContext } from './types';
/**
 * Try to resolve a path-like reference (e.g., "snippets/drawer-menu.liquid")
 * by matching the filename against file nodes.
 */
export declare function matchByFilePath(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
export declare function sameLanguageFamily(a: string, b: string): boolean;
export declare function crossesCodeBoundary(a: string, b: string): boolean;
/** Reject the chosen result without shrinking a pool or trying a replacement. */
export declare function gateLanguageMatch(result: ResolvedRef | null, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Resolve a function-as-value reference (#756) — a function name used as a
 * callback/function-pointer value (`register(handler)`, `o->cb = handler`,
 * `{ .cb = handler }`, `signal(SIGINT, handler)`). The ONLY strategy allowed
 * for `function_ref` refs: exact name, function/method targets only, same
 * language family, same-file first for bare names, and unique-only cross-file.
 * Member values use receiver/type/import scope before a unique-name fallback.
 * A wrong callback edge is worse than none.
 */
export declare function matchFunctionRef(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * A function nested inside another FUNCTION is only callable from within its
 * container — Python, JS/TS, and every closure language scope it lexically.
 * Resolving a bare name from elsewhere to a nested local fabricates an edge
 * scope already rules out: `join(...)` in one function must never bind to a
 * `join` defined inside a DIFFERENT function (#1230). A candidate whose
 * qualifiedName parent is a same-file function/method is kept only when the
 * ref originates inside that parent's line range. Class members are
 * unaffected (their parent resolves to a class-like node), as are top-level
 * symbols and C++ namespace-prefixed names (the prefix has no node).
 */
export declare function isLexicallyReachable(candidate: Node, ref: UnresolvedRef, context: ResolutionContext): boolean;
/**
 * Whether `candidate` can be NAMED from a reference in `ref`'s file at all,
 * given what its language says about the definition's visibility. A
 * definition the language makes file-local is not a candidate for a
 * cross-file name match, however well the names agree:
 *
 * - **C / C++**: a `static` function defined in a SOURCE file is local to
 *   that translation unit; one in a header is part of every unit that
 *   includes it and stays visible. On a 2,109-file betaflight tree 145
 *   cross-file calls resolved onto a `static` in another `.c` (#1730) —
 *   `usbd_get_descriptor` onto the `static get_device_descriptor` of
 *   whichever USB class file ranked first.
 * - **Kotlin, Java, C#, Swift, Scala, Dart, PHP**: `private` is class- or
 *   file-local. An Android `editor.apply()` resolved onto an unrelated class's
 *   `private fun apply`.
 * - **Go**: an unexported (lowercase) identifier is package-local, and a
 *   package is a directory. Judged by the name's case: the extractor's
 *   `isExported` is unset for every Go method.
 * - **Rust**: a non-`pub` item is visible to its module and that module's
 *   descendants, never to a sibling module or another crate — `.count()` on
 *   an iterator resolved onto a `fn count` in a different crate. A method in
 *   an `impl Trait for Type` block has the trait's visibility, not `private`.
 * - **JS / TS / ArkTS**: a binding in a module that exports nothing (an
 *   `import` present, no `export` / CommonJS / `declare global`) is sealed —
 *   the vite playground's `const vite = await createServer(…)` took 157
 *   `import { defineConfig } from 'vite'` edges (#1719). Classic scripts,
 *   CommonJS, later `export { … }`, and ambient globals stay visible.
 *
 * Same-file candidates are always visible. Applied by ReferenceResolver to
 * the target the whole name-matching pipeline settled on, so a rejection ends
 * the reference unresolved: declining inside matchByExactName instead let the
 * ref fall through to matchFuzzy, which then committed to a same-language
 * namesake the ranking had passed over — eight such edges on one tree, all
 * onto a local `const fail = …` arrow the graph does not hold. matchFuzzy
 * checks its own survivor as well, since nothing runs after it.
 */
export declare function isVisibleAcrossFiles(candidate: Node, ref: UnresolvedRef, context: ResolutionContext): boolean;
/** Languages whose identifiers resolve regardless of case. */
export declare const CASE_INSENSITIVE_LANGUAGES: Set<string>;
/**
 * Whether a Python call recorded by its bare name was written on the instance,
 * `self.get_ip(request)`. The extractor drops the `self.`, so a same-named name
 * the file imports would otherwise claim the method call (#2074 follow-up).
 */
export declare function isPythonSelfCall(ref: UnresolvedRef, context: ResolutionContext): boolean;
/**
 * Whether a bare Rust name can mean this candidate. An enum's variant is in
 * scope bare only through a `use` of it or of its enum's `*`, and never
 * names a TYPE — ripgrep's every `Some(x)` bound to its `EncodingMode::Some`
 * variant, every `Ok(x)` to `ParseResult::Ok`. A prelude name (`Ok`,
 * `Result`, `Box`) is the prelude's unless the file defines it or imports a
 * project item of that name — serde's macro-hygiene tests declare `struct
 * Ok`, `struct Result`, and serde bound its own `Ok(…)` and `Result<…>` to them.
 */
export declare function isRustNameInScope(candidate: Node, ref: UnresolvedRef, context: ResolutionContext): boolean;
/**
 * Try to resolve a reference by exact name match
 */
export declare function matchByExactName(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Try to resolve by qualified name
 */
export declare function matchByQualifiedName(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * When a symbol name is ambiguous across files, prefer the candidate(s) declared
 * in the call site's own file, keeping the rest in their original order (#1079).
 * A same-file definition is the strongest language-agnostic signal for which of
 * several same-named symbols a call means; without it, resolution collapses onto
 * whichever was indexed first, so a call in `b/svc` wrongly targets `a/svc`.
 * No-op when there are <2 candidates or none share the call site's file.
 */
export declare function preferCallSiteFile(nodes: Node[], callSiteFile: string): Node[];
/**
 * Resolve `container.member` where `container` is a VALUE holding an object
 * literal — `export const api = { call() {…}, get: () => {…} }` used as the
 * module's namespace (#1573). The members are extracted as plain functions
 * with BARE qualified names inside the constant's source extent (there is no
 * `api::call`), so neither the `Container::member` lookup the class-shaped
 * kinds use (#825) nor the declared-type inference for singleton instances
 * (#1292) can reach them, and every such call resolved to nothing — or, via
 * an import, to the constant itself. This looks the member up by CONTAINMENT:
 * a node named `member` whose range lies inside the container's, in the
 * container's own file. A helper declared inside a member's body is not a
 * member and is skipped; nothing else in the file can donate a match. Calls
 * take callable kinds only; other references accept value members too.
 */
export declare function resolveObjectLiteralMember(container: Node, member: string, ref: UnresolvedRef, context: ResolutionContext, confidence: number, resolvedBy: ResolvedRef['resolvedBy']): ResolvedRef | null;
/**
 * The binding an object-literal member names when it is a shorthand property
 * (`{ getUser }`) or a pair whose value is a bare identifier (`{ getUser:
 * fetchUser }`) — the usual way an API module assembles its namespace from
 * standalone functions (#1932). Only the literal's own members count: a member
 * of a nested object, a word inside a member's body, a comment or a string
 * never donates one. Null when the member is absent, or when its value is not
 * a bare identifier (`{ fn: 1 }` names nothing).
 */
export declare function objectLiteralMemberBinding(container: Node, member: string, context: ResolutionContext): string | null;
/**
 * Shared lexical lookup for namespace-object aliases (#1932): `api.getUser()` where
 * `api` is `const api = { getUser }` (or `{ getUser: fetchUser }`) in the
 * object's own file. The member's function is declared OUTSIDE the literal, so
 * containment (`resolveObjectLiteralMember`) finds nothing. Follow the binding
 * the member names — a symbol of this file, else one of its imports — unless a
 * parameter or nearer declaration shadows that name where the literal is
 * written (the edge would then name the wrong function).
 */
export declare function resolveObjectLiteralBinding(container: Node, member: string, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
export declare function resolveMethodOnType(typeName: string, methodName: string, ref: UnresolvedRef, context: ResolutionContext, confidence: number, resolvedBy: ResolvedRef['resolvedBy'], 
/**
 * Optional FQN that identifies WHICH class declaration `typeName`
 * refers to in the caller's file. When multiple candidates share
 * the same qualifiedName (`FooConverter::convert` in both
 * `dao/converter/` and `service/converter/`), the FQN's
 * file-path-suffix picks the right one — the disambiguation
 * signal Java imports carry but the call site doesn't (#314).
 */
preferredFqn?: string, 
/** Recursion guard for the supertype/conformance walk. */
depth?: number): ResolvedRef | null;
/**
 * Resolve a C++ chained call whose receiver is itself a call — encoded by the
 * extractor as `<innerCallee>().<method>` (#645). The receiver's type is what
 * the inner call returns; the outer method is then resolved and VALIDATED on it
 * (resolveMethodOnType requires `cls::method` to exist), so a wrong inference
 * produces no edge rather than a wrong one.
 */
export declare function matchCppCallChain(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Resolve a `::`-scoped factory chain whose receiver is a scoped/static call —
 * PHP `Cls::for($x)->method()` (#608, the per-credential Laravel client idiom) or
 * Rust `Foo::new().bar()` (an associated-function call) — both encoded by the
 * extractor as `Cls::factory().method`. The receiver's type is what `Cls::factory`
 * returns: a `self` marker (PHP `: self`/`: static`, Rust `-> Self`) resolves to
 * the factory's own type, a concrete return type to that type. The outer method is
 * then resolved and VALIDATED on it (resolveMethodOnType requires the method to
 * exist on the type or a supertype it conforms to), so a wrong inference yields no
 * edge rather than a wrong one. Shared by the `::`-receiver languages (PHP, Rust).
 */
export declare function matchScopedCallChain(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Resolve a dotted chained call whose receiver is a static factory / fluent call —
 * `Foo.getInstance().bar()`, encoded by the extractor as `Foo.getInstance().bar`
 * (#645/#608 mechanism). The receiver's type is what `Foo.getInstance` returns
 * (its declared return type); the outer method is then resolved and VALIDATED on
 * it (resolveMethodOnType requires `Type::method` to exist), so a wrong inference
 * yields no edge rather than a wrong one (e.g. a same-named `bar()` on an
 * unrelated class is never matched). Shared by the dot-notation languages
 * (Java, Kotlin, C#, Swift) — same receiver shape, same `Class::method` qualified names.
 */
export declare function matchDottedCallChain(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Normalize a captured type expression to a simple type name: drop generic
 * args and pointer/ref markers, take the last `.`/`::`-qualified segment, and
 * reject obvious non-types.
 */
export declare function normalizeInferredTypeName(raw: string): string | null;
/** Drop the per-context scan states (see ReferenceResolver.clearCaches). */
export declare function clearNameMatcherMemos(context: ResolutionContext): void;
export declare function localReceiverTypePatterns(language: Language, r: string): RegExp[];
/**
 * Try to resolve by method name on a class/object
 */
export declare function matchMethodCall(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/**
 * Reduce a Rust field's declared type text to the simple name of the type a
 * method call on that field auto-derefs to, or null when there is none we can
 * name. Only the layers Rust's method-call auto-deref looks through are
 * unwrapped: references (`&`, `&'a mut`) and the owning smart pointers
 * (`Box`, `Rc`, `Arc`) — `self.inner.run()` with `inner: Box<Inner>` calls
 * `Inner::run`. Containers that do NOT auto-deref to their parameter
 * (`Option<Inner>`, `Vec<Inner>`, `Mutex<Inner>`, `RefCell<Inner>`) keep their
 * own name and, having no project node, resolve to nothing — `self.items.push()`
 * must never become `Inner::push`. A trait object (`Box<dyn Source>`) yields
 * the trait, whose method node the interface-impl synthesizer fans out. A
 * generic parameter (`T`), a primitive, a tuple / array / raw pointer / fn
 * type, or a non-identifier yields null.
 */
export declare function rustFieldTypeName(raw: string): string | null;
/** Bound action names need not have a same-named definition (selectors may
 * rename them). The resolver's symbol-existence prefilter must allow them. */
export declare function matchJsStoreBindingCall(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/** A qualified untyped chain is useful source evidence, not permission to
 * infer a property type. Framework resolution runs before this guard. Vue,
 * Svelte and Astro files keep resolving them: there `api.groupReports.getAll()`
 * reaches its API client class far more often than a wrong namesake. */
export declare function isUnresolvedJsMemberCall(ref: UnresolvedRef): boolean;
/**
 * Fuzzy match - last resort with lower confidence
 */
export declare function matchFuzzy(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
/** Dump this thread's matchReference sub-stage table to stderr (no-op unless =2). */
export declare function dumpNameMatcherProfile(label: string): void;
export declare function matchReference(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
//# sourceMappingURL=name-matcher.d.ts.map