import { DatabaseSession } from '../session/DatabaseSession.js';
import { ArcadeSupportedQueryLanguages } from '../database/Database.js';
import { SpriteTransaction } from './SpriteTransaction.js';
/**
 * isolationLevel is the isolation level for the current transaction,
 * either `READ_COMMITTED` or `REPEATABLE_READ`. For details on what
 * isolation level dictates about the transaction, see the [ArcadeDB
 * documentation](https://docs.arcadedb.com/#HTTP-Begin)
 * @default READ_COMMITTED
 */
export type ArcadeTransactionIsolationLevel = 'READ_COMMITTED' | 'REPEATABLE_READ';
/**
 * Static class for performing operations on or in a transaction.
 */
export declare class Transaction {
    /**
     * Static method to begin a transaction.
     * @param session The {@link DatabaseSession `DatabaseSession`} to begin the transaction on.
     * @param isolationLevel The isolation level of the transaction.
     * @returns A {@link SpriteTransaction `SpriteTransaction`} instance for the target session.
     */
    static begin: (session: DatabaseSession, isolationLevel?: ArcadeTransactionIsolationLevel) => Promise<SpriteTransaction>;
    /**
     * Static method to commit a transaction.
     * @param session The {@link DatabaseSession `DatabaseSession`} to commit the transaction on.
     * @param transaction The id of the transaction to commit.
     * @returns `true` if the transaction was committed.
     */
    static commit: (session: DatabaseSession, transaction: SpriteTransaction) => Promise<boolean>;
    /**
     * Static method to rollback a transaction.
     * @param session The {@link DatabaseSession `DatabaseSession`} to rollback the transaction on.
     * @param transaction The id of the transaction to rollback.
     * @returns `true` if the transaction was rolled back.
     */
    static rollback: (session: DatabaseSession, transaction: SpriteTransaction) => Promise<boolean>;
    /**
     * Static method to manage a transaction within the scope.
     * @param session The {@link DatabaseSession `DatabaseSession`} to execute the transaction on.
     * @param callback The callback to execute within transaction context.
     * @param isolationLevel The {@link ArcadeTransactionIsolationLevel isolationLevel} of the transaction.
     * @returns A touple containing result of the transaction, and a boolean indicating if the transaction was committed or rolled-back.
     */
    static manage: <T = void>(session: DatabaseSession, callback: (trx: SpriteTransaction) => Promise<T>, isolationLevel?: ArcadeTransactionIsolationLevel) => Promise<[boolean, T]>;
    /**
     * Static method to execute CRUD as part of a transaction.
     * @param language The {@link ArcadeSupportedQueryLanguages `ArcadeSupportedQueryLanguages`} to use for the command.
     * @param command The CRUD command to execute.
     * @param params The parameters to pass to the command.
     * @returns The result of the CRUD operation.
     * @throws Error if the CRUD operation fails.
     */
    static crud: <T>(session: DatabaseSession, transaction: SpriteTransaction, language: ArcadeSupportedQueryLanguages, command: string, params?: Record<string, boolean | string | number>) => Promise<T>;
}
