import type { EntityManager } from 'typeorm'; export type AfterCommitStep = { name: string; run: () => unknown | Promise; }; export type AfterCommit = AfterCommitStep[]; /** Adds a step. With no list (outside a transaction) it returns false, and the caller does it at once. */ export declare function whenCommitted(afterCommit: AfterCommit | undefined, name: string, run: AfterCommitStep['run']): boolean; /** Runs the steps in order. A failing one is reported by name and the rest still run. */ export declare function runAfterCommit(afterCommit: AfterCommit, report: (message: string, error: unknown) => void): Promise; /** * Opens the transaction, hands the body the list, and runs the list once committed. The directive and * any code that opens a transaction by hand share it. transact has the shape of dataSource.transaction: * if the body throws, it rolls back and throws. */ export declare function runTransaction(transact: (work: (tx: TX) => Promise) => Promise, body: (tx: TX, afterCommit: AfterCommit) => Promise, report: (message: string, error: unknown) => void): Promise; /** * Attach an effect to the actual manager transaction, including callers using * EntityManager.transaction directly rather than the GraphQL directive. * Savepoint commits defer to the outer commit; rolled-back savepoint effects are dropped. * This is best-effort post-commit delivery, not a durable outbox. */ export declare function afterManagerCommit(tx: EntityManager | undefined, name: string, run: AfterCommitStep['run'], report: (message: string, error: unknown) => void): Promise;