/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import type { MaybePromise } from "#util/Promises.js";
import { StorageTransaction } from "../StorageTransaction.js";
import type { SupportedStorageTypes } from "../StringifyTools.js";
import type { StoreData, WalCommit, WalCommitId, WalOp } from "./WalCommit.js";
import type { WalStorageDriver } from "./WalStorageDriver.js";
import type { WalWriter } from "./WalWriter.js";
/**
 * Callback to notify the owning storage of a new commit ID, timestamp, and committed operations.
 */
export type WalCommitNotify = (id: WalCommitId, ts: number, ops: WalOp[]) => void;
/**
 * A transaction that buffers WAL operations and writes them atomically on commit.
 *
 * Owns the write path: serializes ops to the WAL writer and notifies the storage to update its cache.
 */
export declare class WalTransaction extends StorageTransaction {
    #private;
    constructor(storage: WalStorageDriver, writer: WalWriter, onCommit: WalCommitNotify);
    get(contexts: string[], key: string): MaybePromise<SupportedStorageTypes | undefined>;
    set(contexts: string[], values: Record<string, SupportedStorageTypes>): MaybePromise<void>;
    set(contexts: string[], key: string, value: SupportedStorageTypes): MaybePromise<void>;
    delete(contexts: string[], key: string): MaybePromise<void>;
    clearAll(contexts: string[]): MaybePromise<void>;
    keys(contexts: string[]): MaybePromise<string[]>;
    values(contexts: string[]): MaybePromise<Record<string, SupportedStorageTypes>>;
    contexts(contexts: string[]): MaybePromise<string[]>;
    commit(): Promise<void>;
    protected rollback(): void;
}
/**
 * Apply a WAL commit to an in-memory store.  Used by WalStorage when loading the cache from snapshot + WAL replay.
 */
export declare function applyCommit(store: StoreData, commit: WalCommit): void;
//# sourceMappingURL=WalTransaction.d.ts.map