/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type ChangeRebaser, type GraphCommit } from "../core/index.js";
import type { SharedTreeBranchChange } from "./branch.js";
import type { ChangeEnricherReadonlyCheckout } from "./changeEnricher.js";
/**
 * Utility for enriching commits from a {@link Branch} before these commits are applied and submitted.
 */
export declare class BranchCommitEnricher<TChange> {
    #private;
    constructor(rebaser: ChangeRebaser<TChange>, enricher: ChangeEnricherReadonlyCheckout<TChange>);
    /**
     * Process the given change, preparing new commits for {@link BranchCommitEnricher.enrich | enrichment}.
     * @param change - The change to process.
     */
    processChange(change: SharedTreeBranchChange<TChange>): void;
    /**
     * Retrieves the enriched version of the given commit.
     * @param commit - A commit {@link BranchCommitEnricher.processChange | processed during the most recent change}.
     * @remarks A commit can only be enriched once - subsequent calls to this method with the same commit will throw an error.
     */
    enrich(commit: GraphCommit<TChange>): GraphCommit<TChange>;
    /**
     * Notify the enricher that a new transaction has started.
     * @remarks This may be called multiple times without calling {@link BranchCommitEnricher.commitTransaction | commitTransaction}, producing "nested transactions".
     */
    startTransaction(): void;
    /**
     * Commit the current transaction.
     * @remarks This should be called _before_ the corresponding transaction commit change is {@link BranchCommitEnricher.processChange | processed}.
     */
    commitTransaction(): void;
    /**
     * Notify the enricher that the current transaction has been aborted.
     * @remarks This will throw an error if there is no ongoing transaction.
     */
    abortTransaction(): void;
    /**
     * Add new transaction commits to the current transaction.
     * @param newCommits - The new commits to add.
     * @remarks This will throw an error if there is no ongoing transaction.
     */
    addTransactionCommits(newCommits: Iterable<GraphCommit<TChange>>): void;
}
//# sourceMappingURL=branchCommitEnricher.d.ts.map