/**
 * Type Hierarchy Resolution
 *
 * Tracks class inheritance and interface implementations across files
 * to enable polymorphic sink detection.
 *
 * Example: When sink is Statement.executeQuery(), we can match calls
 * on PreparedStatement, CallableStatement, or any other subtype.
 */
import type { TypeInfo, TypeHierarchy as TypeHierarchyData, CircleIR } from '../types/index.js';
/**
 * Node representation for hierarchy tracking
 */
export interface TypeNode {
    name: string;
    fqn: string;
    kind: 'class' | 'interface' | 'enum';
    extends: string | null;
    implements: string[];
    extendsInterfaces: string[];
    file: string;
    line: number;
}
/**
 * TypeHierarchyResolver - Builds and queries type inheritance relationships
 */
export declare class TypeHierarchyResolver {
    private types;
    private nameToFqn;
    private subtypes;
    private implementations;
    private _subtypeCache;
    private _implCache;
    /**
     * Add types from a CircleIR analysis result
     */
    addFromIR(ir: CircleIR, filePath: string): void;
    /**
     * Add a single type to the hierarchy
     */
    addType(type: TypeInfo, filePath: string, defaultPackage?: string | null): void;
    /**
     * Get all direct subtypes of a class
     */
    getDirectSubtypes(className: string): string[];
    /**
     * Get all subtypes (transitive) of a class
     */
    getAllSubtypes(className: string): string[];
    /**
     * Get all direct implementations of an interface
     */
    getDirectImplementations(interfaceName: string): string[];
    /**
     * Get all implementations (including through subinterfaces) of an interface
     */
    getAllImplementations(interfaceName: string): string[];
    /**
     * Check if a type is a subtype of another (including transitive)
     */
    isSubtypeOf(childName: string, parentName: string): boolean;
    /**
     * Check if a type implements an interface (directly or through inheritance)
     * Also handles interface-extends-interface relationships
     */
    implementsInterface(typeName: string, interfaceName: string): boolean;
    /**
     * Get type info by name
     */
    getType(name: string): TypeNode | undefined;
    /**
     * Get all types matching a simple name
     */
    getTypesByName(simpleName: string): TypeNode[];
    /**
     * Get the file where a type is defined
     */
    getTypeFile(name: string): string | undefined;
    /**
     * Check if a receiver type could match a target class
     * Handles: exact match, subtype, implementation, simple name match
     */
    couldBeType(receiverType: string, targetClass: string): boolean;
    /**
     * Export hierarchy data in the CircleIR format
     */
    toTypeHierarchyData(): TypeHierarchyData;
    /**
     * Get statistics about the hierarchy
     */
    getStats(): {
        totalTypes: number;
        classes: number;
        interfaces: number;
        enums: number;
    };
    /**
     * Get all types in the hierarchy
     */
    getAllTypes(): TypeNode[];
    /**
     * Clear all data
     */
    clear(): void;
    /**
     * Resolve a type name to its FQN
     */
    private resolveTypeName;
    /**
     * Resolve a name (simple or FQN) to its FQN
     */
    private resolveFqn;
    /**
     * Get simple name from FQN
     */
    private getSimpleName;
    /**
     * Get package from FQN
     */
    private getPackage;
}
/**
 * Pre-populated common Java type hierarchy
 * These are standard JDK types that code often extends/implements
 */
export declare function createWithJdkTypes(): TypeHierarchyResolver;
//# sourceMappingURL=type-hierarchy.d.ts.map