import type { Diagnostic } from "../diagnostics/types.js"; import type { MelExprNode } from "../lowering/lower-expr.js"; import type { MelIRPatchPath } from "../lowering/lower-runtime-patch.js"; import type { GuardedStmtNode, InnerStmtNode, PatchStmtNode } from "../parser/ast.js"; import { toMelExpr } from "./compile-mel-patch-expr.js"; export interface PatchCollectContext { readonly actionName: string; } type AllowedSysPrefix = "input" | "runtime" | "context"; export type ConditionedPatchStatement = { patch: PatchStmtNode; condition?: MelExprNode; }; export interface PatchCollectorDeps { toMelExpr: (expr: Parameters[0]) => MelExprNode; mapLocation: (location: Diagnostic["location"]) => Diagnostic["location"]; } export declare class PatchStatementCollector { private readonly deps; private readonly exprValidator; constructor(deps: PatchCollectorDeps, allowSysPrefixes?: readonly AllowedSysPrefix[]); collect(stmts: GuardedStmtNode[] | InnerStmtNode[], errors: Diagnostic[], context: PatchCollectContext, parentCondition: MelExprNode | undefined): ConditionedPatchStatement[]; private collectPatchStatements; private pushUnsupportedControlError; } export declare function compilePatchStmtToMelRuntime(patchStatement: ConditionedPatchStatement): { op: "set" | "unset" | "merge"; path: MelIRPatchPath; value?: MelExprNode; condition?: MelExprNode; }; export {};