/**
 * Type environment helpers
 *
 * Extends ProgramContext.typeEnv with deterministic types discovered during conversion.
 *
 * IMPORTANT:
 * - This is NOT TypeScript type-checking.
 * - This is deterministic, IR-derived typing used to avoid "unknown" fallbacks
 *   for common local variables (e.g., `const ok = x !== undefined` → boolean).
 */
import * as ts from "typescript";
import type { ProgramContext } from "../program-context.js";
import type { IrExpression, IrParameter, IrType, IrVariableDeclaration, IrVariableDeclarator } from "../types.js";
/**
 * Derive the type from a converted IR expression using deterministic rules.
 * NO TYPESCRIPT FALLBACK - types must be derivable from IR or undefined.
 *
 * DETERMINISTIC TYPING RULES:
 * - Literals → use inferredType (already set deterministically in literals.ts)
 * - Arrays → use inferredType, or derive from first element
 * - All other expressions → use inferredType if present
 */
export declare const deriveTypeFromExpression: (expr: IrExpression) => IrType | undefined;
export declare const withBindingNameTypeEnv: (ctx: ProgramContext, name: ts.BindingName, type: IrType | undefined) => ProgramContext;
export declare const withParameterTypeEnv: (ctx: ProgramContext, tsParameters: readonly ts.ParameterDeclaration[], parameters: readonly IrParameter[]) => ProgramContext;
export declare const withVariableDeclaratorTypeEnv: (ctx: ProgramContext, name: ts.BindingName, decl: IrVariableDeclarator) => ProgramContext;
/**
 * Extend ctx.typeEnv with deterministic types for declared variables.
 *
 * Used to type later references to locals without resorting to "unknown" fallbacks.
 * This is required for correct emission of operators like `!x` (boolean vs truthiness).
 */
export declare const withVariableTypeEnv: (ctx: ProgramContext, tsDecls: readonly ts.VariableDeclaration[], ir: IrVariableDeclaration) => ProgramContext;
//# sourceMappingURL=type-env.d.ts.map