/** * Command-scoped `compute` bindings for Convex mutation lowering. * * Spec (semantics.md § Actions): `compute = ` binds `` into * command evaluation scope for later actions and event payloads. It MUST NOT * mutate entity state and is never persisted. * * Expressions are evaluated against the pre-update document (`beforeScope`), * matching runtime order (compute runs before mutate in the action loop). */ import type { IRCommand } from '../../ir.js'; import type { ProjectionDiagnostic } from '../interface.js'; import { type RenderScope } from './expression.js'; export interface ComputeBinding { /** Local binding name (`previousStatus`, `nextQuantity`, …). */ name: string; /** TypeScript expression evaluated against the pre-update scope. */ code: string; } /** * Lower IR `compute` actions to ordered local bindings. * Later computes may reference earlier binding names via `locals`. */ export declare function renderCommandComputeBindings(cmd: IRCommand, beforeScope: RenderScope): { bindings: ComputeBinding[]; diagnostics: ProjectionDiagnostic[]; localNames: string[]; }; /** `const name = expr;` lines for the mutation handler body. */ export declare function computeBindingLines(bindings: ComputeBinding[]): string[]; /** Merge compute binding names into a render scope's locals. */ export declare function withComputeLocals(scope: RenderScope, computeLocals: readonly string[]): RenderScope; //# sourceMappingURL=compute-bindings.d.ts.map