import { Transaction } from 'kysely'; import Dream from '../Dream.js'; import { HookStatement } from '../types/lifecycle.js'; export interface TransactionCommitHookStatement { hookStatement: HookStatement; dreamInstance: Dream; } export default class DreamTransaction { private _kyselyTransaction; private commitHooks; private committed; get kyselyTransaction(): Transaction; set kyselyTransaction(txn: Transaction); addCommitHook(hookStatement: HookStatement, dreamInstance: Dream): void; /** * Runs the commit hooks queued during the transaction, in the order they * were queued. A query driver calls this once the transaction has * committed. Each hook is called with no argument, since the transaction * it would otherwise receive can no longer run queries. */ runAfterCommitHooks(): Promise; }