import { UseCaseLike } from "../UseCaseLike"; import { UseCaseExecutor } from "../UseCaseExecutor"; import { FunctionalUseCase } from "../FunctionalUseCase"; import { UseCaseFunction } from "../FunctionalUseCaseContext"; export interface TransactionContext { /** * Unique id */ id: string; /** * Create new UseCaseExecutor and run useCase in the transaction */ useCase(useCase: T): UseCaseExecutor; useCase(useCase: UseCaseFunction): UseCaseExecutor; /** * Commit current queued payloads and exit the transaction. */ commit: () => void; /** * Exit the transaction without commit. */ exit: () => void; }