/**
 * IR Type Substitution -- Substitution Application and Map Builders
 *
 * Provides substituteIrType for applying substitutions, and builder
 * functions for constructing substitution maps from receivers,
 * explicit type args, and call arguments.
 */
import type { IrType } from "./ir-types.js";
import { type TypeSubstitutionMap, type SubstitutionResult } from "./ir-substitution-core.js";
/**
 * Apply type parameter substitutions to an IrType.
 *
 * Given a type with type parameters and a substitution map,
 * returns a new type with all type parameters replaced.
 *
 * Examples:
 * - substituteIrType(T, { "T" -> int }) -> int
 * - substituteIrType(List<T>, { "T" -> int }) -> List<int>
 * - substituteIrType(T | null, { "T" -> int }) -> int | null
 *
 * If no substitutions apply, returns the original type unchanged.
 */
export declare const substituteIrType: (type: IrType, substitutions: TypeSubstitutionMap) => IrType;
/**
 * Build IR substitution map from a receiver's type and the formal type parameters.
 *
 * Given a receiver like `list: List<int>` and a formal interface with type parameter T,
 * returns { "T" -> int }.
 *
 * This is the IR-level equivalent of buildTypeParameterSubstitutionMap from calls.ts,
 * but works entirely at the IR level without TS AST archaeology.
 */
export declare const buildIrSubstitutionMap: (receiverType: IrType, formalTypeParams: readonly string[]) => TypeSubstitutionMap | undefined;
/**
 * Build substitution map from explicit call type arguments.
 *
 * For a call like `identity<int>(x)` with formal type param `T`,
 * returns { "T" -> int }.
 *
 * This is binding source #2: explicit type arguments in the call.
 */
export declare const buildSubstitutionFromExplicitTypeArgs: (explicitTypeArgs: readonly IrType[], formalTypeParams: readonly string[]) => TypeSubstitutionMap | undefined;
/**
 * Build substitution map from call arguments via bounded unification.
 *
 * For a call like `identity(a)` where `a: int` and formal param is `x: T`,
 * returns { "T" -> int }.
 *
 * This is binding source #3: argument-driven unification.
 * No body analysis - just matches argument types against parameter types.
 *
 * Returns SubstitutionResult to detect conflicts (TSN5202):
 * - If T binds to `int` from arg0 and `long` from arg1, returns conflict error
 */
export declare const buildSubstitutionFromArguments: (argTypes: readonly (IrType | undefined)[], formalParamTypes: readonly (IrType | undefined)[]) => SubstitutionResult;
/**
 * Complete substitution with separate maps for receiver and call type params.
 * This avoids name collisions between class type params (T in List<T>)
 * and method type params (T in Select<T>).
 */
export type CompleteSubstitution = {
    readonly receiverSubst: TypeSubstitutionMap;
    readonly callSubst: TypeSubstitutionMap;
};
/**
 * Result of building complete substitution - success or conflict error.
 */
export type CompleteSubstitutionResult = {
    readonly ok: true;
    readonly substitution: CompleteSubstitution;
} | {
    readonly ok: false;
    readonly conflict: {
        readonly param: string;
        readonly type1: IrType;
        readonly type2: IrType;
    };
};
/**
 * Build complete substitution map from all 3 binding sources.
 *
 * Keeps receiver and call substitutions SEPARATE to avoid name collisions.
 *
 * Priority order for call substitutions:
 * 1. Explicit call type arguments (e.g., `identity<int>(x)` -> T=int)
 * 2. Argument-driven unification (e.g., `identity(a:int)` -> T=int)
 *
 * Receiver substitutions are separate and used for instantiating member signatures.
 */
export declare const buildCompleteSubstitutionMap: (receiverType: IrType | undefined, receiverFormalTypeParams: readonly string[], explicitTypeArgs: readonly IrType[], callFormalTypeParams: readonly string[], argTypes: readonly (IrType | undefined)[], formalParamTypes: readonly (IrType | undefined)[]) => CompleteSubstitutionResult;
//# sourceMappingURL=ir-substitution-builders.d.ts.map