import type { ScopeInfo, TypeCheckerContext } from "./types.js"; /** * Declare each `finalize as ` binder into its scope, typed * `T | null`. A sibling of refineInlineHandlerParams: runs pre-flow so * checkScopes and the flow passes see the binding, and declares into * the FUNCTION scope (the finalize body has no scope of its own). * * A binder that collides with an existing name is an error (AG6037), * not a shadow: the binder compiles to a bare closure parameter, and a * colliding reference would resolve to `__stack.locals.` — the * local — instead. The collision rule is what makes the codegen sound. * The check is deliberately `lookupInFunction`, not `has`: the hazard * is a same-frame local or param, and `has` walks into the module * scope, where a global-named binder is NOT a hazard (globals compile * through `__globals()`, not the frame). * * Accepted limitation (mirrors inline handler params, scopes.ts): the * declaration is function-wide, so a reference to the binder OUTSIDE * the finalize is not flagged as undefined here. */ export declare function declareFinalizeBinders(scopes: ScopeInfo[], ctx: TypeCheckerContext): void;