import type { Enum } from '../../../shared/src/enum.ts';
import type { InternalDiff } from '../btree/node.ts';
import type { Read } from '../dag/store.ts';
import { Commit, type Meta } from '../db/commit.ts';
import * as FormatVersion from '../format-version-enum.ts';
import type { Hash } from '../hash.ts';
type FormatVersion = Enum<typeof FormatVersion>;
/**
 * Interface allowing different diff functions to skip costly diff computations.
 */
export interface DiffComputationConfig {
    shouldComputeDiffs(): boolean;
    shouldComputeDiffsForIndex(name: string): boolean;
}
/**
 * The diffs in different indexes. The key of the map is the index name.
 * "" is used for the primary index.
 */
export declare class DiffsMap extends Map<string, InternalDiff> {
    set(key: string, value: InternalDiff): this;
}
/**
 * Diffs the state of the db at two different hashes.
 * It will include the primary indexes as well as all the secondary indexes.
 */
export declare function diff(oldHash: Hash, newHash: Hash, read: Read, diffConfig: DiffComputationConfig, formatVersion: FormatVersion): Promise<DiffsMap>;
/**
 * Diffs the state of the db at two different commits.
 * It will include the primary indexes as well as all the secondary indexes.
 */
export declare function diffCommits(oldCommit: Commit<Meta>, newCommit: Commit<Meta>, read: Read, diffConfig: DiffComputationConfig, formatVersion: FormatVersion): Promise<DiffsMap>;
export declare function addDiffsForIndexes(mainCommit: Commit<Meta>, syncCommit: Commit<Meta>, read: Read, diffsMap: DiffsMap, diffConfig: DiffComputationConfig, formatVersion: FormatVersion): Promise<void>;
export {};
//# sourceMappingURL=diff.d.ts.map