/** * @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; set(contexts: string[], values: Record): MaybePromise; set(contexts: string[], key: string, value: SupportedStorageTypes): MaybePromise; delete(contexts: string[], key: string): MaybePromise; clearAll(contexts: string[]): MaybePromise; keys(contexts: string[]): MaybePromise; values(contexts: string[]): MaybePromise>; contexts(contexts: string[]): MaybePromise; commit(): Promise; 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