import * as binaryen from "./wasm-encoder.js"; import type { Expression } from "../ast/nodes.js"; import { type FunctionSig, FunctionContext } from "./types.js"; /** * Walk a lambda body and collect identifiers that reference variables from * the enclosing scope ("free variables"). These are the values that must be * stored in a closure environment record. */ export declare function collectFreeVariables(body: Expression[], paramNames: Set, constGlobals: Map, fnSigs: Map): Map; /** * Allocate a closure pair on the heap: [table_index: i32, env_ptr: i32]. * Returns a block expression that evaluates to the pair's heap pointer. */ export declare function allocClosurePair(mod: binaryen.Module, ctx: FunctionContext, tableIndexExpr: binaryen.ExpressionRef, envPtrExpr: binaryen.ExpressionRef, uniqueId: string): binaryen.ExpressionRef; //# sourceMappingURL=closures.d.ts.map