import { DispatcherPayloadMeta } from "../DispatcherPayloadMeta"; import { DebugId } from "../instrument/AlminAbstractPerfMarker"; import { DispatchedPayload } from "../Dispatcher"; import { Events } from "../Events"; /** * Commitment is a tuple of payload and meta. * It is a minimal unit of transaction. * * Notes: Why commitment is object? * commitment is collect as array at once. * Pass it StoreGroup directly. * If use ...arguments, it has spread cost by transpiler. * */ export declare type Commitment = { payload: DispatchedPayload; meta: DispatcherPayloadMeta; debugId: DebugId; }; /** * Unit of work committing target */ export interface Committable { commit(commitment: Commitment): void; } export declare type UnitOfWorkEvent = Commitment; export declare class UnitOfWork extends Events { private commitments; private committable; id: string; isDisposed: boolean; /** * @param {Committable} committable it is often StoreGroup */ constructor(committable: Committable); get size(): number; addCommitment(commitment: Commitment): void; onAddedCommitment(handler: (commitment: Commitment) => void): import("../Events").EventDisposable; commit(): void; prune(): void; release(): void; }