import type { LogContext } from '@rocicorp/logger';
import type { Enum } from '../../../shared/src/enum.ts';
import { BTreeRead } from '../btree/read.ts';
import { BTreeWrite } from '../btree/write.ts';
import type { FrozenCookie } from '../cookies.ts';
import type { Write as DagWrite } from '../dag/store.ts';
import * as FormatVersion from '../format-version-enum.ts';
import type { FrozenJSONValue } from '../frozen-json.ts';
import { type Hash } from '../hash.ts';
import type { DiffComputationConfig } from '../sync/diff.ts';
import { DiffsMap } from '../sync/diff.ts';
import type { ClientID } from '../sync/ids.ts';
import type { Commit } from './commit.ts';
import { type Meta as CommitMeta } from './commit.ts';
import { IndexWrite } from './index.ts';
import { Read } from './read.ts';
type FormatVersion = Enum<typeof FormatVersion>;
export declare class Write extends Read {
    #private;
    map: BTreeWrite;
    readonly indexes: Map<string, IndexWrite>;
    constructor(dagWrite: DagWrite, map: BTreeWrite, basis: Commit<CommitMeta> | undefined, meta: CommitMeta, indexes: Map<string, IndexWrite>, clientID: ClientID, formatVersion: FormatVersion);
    /**
     * The value needs to be frozen since it is kept in memory and used later for
     * comparison as well as returned in `get`.
     */
    put(lc: LogContext, key: string, value: FrozenJSONValue): Promise<void>;
    getMutationID(): Promise<number>;
    del(lc: LogContext, key: string): Promise<boolean>;
    clear(): Promise<void>;
    putCommit(): Promise<Commit<CommitMeta>>;
    commit(headName: string): Promise<Hash>;
    commitWithDiffs(headName: string, diffConfig: DiffComputationConfig): Promise<[Hash, DiffsMap]>;
    close(): void;
}
export declare function newWriteLocal(basisHash: Hash, mutatorName: string, mutatorArgsJSON: FrozenJSONValue, originalHash: Hash | null, dagWrite: DagWrite, timestamp: number, clientID: ClientID, formatVersion: FormatVersion): Promise<Write>;
export declare function newWriteSnapshotDD31(basisHash: Hash, lastMutationIDs: Record<ClientID, number>, cookieJSON: FrozenCookie, dagWrite: DagWrite, clientID: ClientID, formatVersion: FormatVersion): Promise<Write>;
export declare function updateIndexes(lc: LogContext, indexes: Map<string, IndexWrite>, key: string, oldValGetter: () => Promise<FrozenJSONValue | undefined>, newVal: FrozenJSONValue | undefined): Promise<void>;
export declare function readIndexesForWrite(commit: Commit<CommitMeta>, dagWrite: DagWrite, formatVersion: FormatVersion): Map<string, IndexWrite>;
export declare function createIndexBTree(lc: LogContext, dagWrite: DagWrite, valueMap: BTreeRead, prefix: string, jsonPointer: string, allowEmpty: boolean, formatVersion: FormatVersion): Promise<BTreeWrite>;
export {};
//# sourceMappingURL=write.d.ts.map