/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { ClientStructure } from "#node/client/ClientStructure.js"; import type { ClientNode } from "#node/ClientNode.js"; import { MaybePromise } from "@matter/general"; import { WriteResult, type Val } from "@matter/protocol"; import { type EndpointNumber } from "@matter/types"; /** * Persistence handler for {@link ClientNodeStore}. * * A remote writer conveys updates to the remote node. This performs actual persistence for client nodes where the * local store is just a cache and the source of truth is on the remote device. * * The optional {@link RemoteWriter.FailureHandler} is invoked with the per-attribute failure statuses before the * write rejects, giving callers a chance to compensate local cache state for declined writes. */ export interface RemoteWriter { (request: RemoteWriter.Request, onFailure?: RemoteWriter.FailureHandler): Promise; } export declare function RemoteWriter(node: ClientNode, structure: ClientStructure): RemoteWriter; export declare namespace RemoteWriter { interface EndpointUpdateRequest { number: EndpointNumber; behaviorId: string; values: Val.Struct; } interface Request extends Array { } type FailureHandler = (failures: WriteResult.AttributeStatus[]) => MaybePromise; } //# sourceMappingURL=RemoteWriter.d.ts.map