/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class LocalWriter {
  #nodeStore;
  constructor(nodeStore) {
    this.#nodeStore = nodeStore;
  }
  async persist(endpointNumber, behaviorId, values) {
    await this.#nodeStore.storeForEndpointNumber(endpointNumber).set({ [behaviorId]: values });
  }
  /**
   * Persist values through a shared transaction.  The caller owns the transaction lifecycle.
   */
  async persistInTransaction(tx, endpointNumber, behaviorId, values) {
    await this.#nodeStore.storeForEndpointNumber(endpointNumber).set({ [behaviorId]: values }, tx);
  }
  erase(endpointNumber, behaviorId) {
    return this.#nodeStore.storeForEndpointNumber(endpointNumber).eraseStoreForBehavior(behaviorId);
  }
}
export {
  LocalWriter
};
//# sourceMappingURL=LocalWriter.js.map
