import type { TransactionConfig } from './EntityQueryContext.ts'; import { EntityNestedTransactionalQueryContext, EntityNonTransactionalQueryContext, EntityTransactionalQueryContext, TransactionalDataLoaderMode } from './EntityQueryContext.ts'; /** * A query context provider vends transactional and non-transactional query contexts. */ export declare abstract class EntityQueryContextProvider { /** * Vend a regular (non-transactional) entity query context. */ getQueryContext(): EntityNonTransactionalQueryContext; /** * Get the query interface for constructing a query context. */ protected abstract getQueryInterface(): any; /** * @returns true if the transactional dataloader should be disabled for all transactions. */ protected defaultTransactionalDataLoaderMode(): TransactionalDataLoaderMode; /** * Vend a transaction runner for use in runInTransactionAsync. */ protected abstract createTransactionRunner(transactionConfig?: TransactionConfig): (transactionScope: (queryInterface: any) => Promise) => Promise; protected abstract createNestedTransactionRunner(outerQueryInterface: any): (transactionScope: (queryInterface: any) => Promise) => Promise; /** * Start a transaction and execute the provided transaction-scoped closure within the transaction. * @param transactionScope - async callback to execute within the transaction */ runInTransactionAsync(transactionScope: (queryContext: EntityTransactionalQueryContext) => Promise, transactionConfig?: TransactionConfig): Promise; /** * Start a nested transaction from the specified parent transaction and execure the * provided nested-transaction-scoped closure within the nested transaction. * @param outerQueryContext - the query context of the parent transaction * @param transactionScope - async callback to execute within the nested transaction */ runInNestedTransactionAsync(outerQueryContext: EntityTransactionalQueryContext, transactionScope: (innerQueryContext: EntityNestedTransactionalQueryContext) => Promise): Promise; }