/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import type { Duration, ServerAddressUdp } from "@matter/general"; /** * Represents a client request with customizable transmission behavior. */ export interface ClientRequest { /** * The ID of the network. * * Controls throttling behavior for interactions with the node. Use "unlimited" to disable throttling. * * matter.js selects a default network automatically based on the network medium and, in the case of thread, the * wireless channel. * * @see {@link NetworkProfile} */ network?: string; /** * Override the peer-medium MRP retransmission margin for this interaction. * * By default the margin derives from the peer's network medium (e.g. thread's longer margin), independent of * the {@link network} throttle profile. Set this to override that default for a single interaction. */ additionalMrpDelay?: Duration; /** * Override the destination address for this interaction's exchange. * * When set, messages are sent to this address instead of the session's default peer address, * without affecting other exchanges on the session. */ addressOverride?: ServerAddressUdp; /** * Override the wait applied to a one-shot interaction with an idle LIT (Long Idle Time) ICD peer. * * A LIT peer is asleep most of the time, so matter.js holds the operation until the peer wakes (a Check-In or any * other message from the peer re-arms the awake window) before transmitting. By default it waits until the peer's * next Check-In is due, and at least the longest the peer may idle; set this to bound it per-call. On * expiry the operation rejects with `IcdPeerAsleepError`. Ignored for non-LIT peers. */ icdAwaitTimeout?: Duration; /** * Abandon this interaction when the signal aborts. * * The exchange stops sending and stops waiting — no further MRP retransmission — and the operation * rejects with `AbortedError`. A caller that must bound an interaction more tightly than the * peer's own response time uses this; without it the operation runs until matter.js gives up on * the peer, which is a property of the peer rather than of the caller's deadline. * * Aborting abandons the interaction rather than telling the peer anything, so a write or invoke * already in flight may still be acted on by the peer. A subscribe is the exception: after it rejects, the * client answers the peer's pending report on the subscribe exchange with INVALID_SUBSCRIPTION, or waits up to the * peer's response time for the next one, so the peer drops the subscription. If the abort comes after the final * priming report was answered but before the SubscribeResponse, only the peer's next report, up to its max * interval later, is refused. */ abort?: AbortSignal; /** * Require a session that permits payloads larger than the IPv6 MTU. * * Such a session runs over TCP, so this is a hard transport requirement rather than a preference: * the interaction establishes a TCP-backed session or fails, and never falls back to MRP the way * a peer's transport preference does. A peer that negotiates TCP and then denies supporting it * fails with `TcpUnsupportedError`; one that simply cannot be reached over TCP fails however that * connection attempt fails. Use it when the interaction's request or its response may exceed what * MRP can carry — a command with Large Message Quality, or a read broad enough that the peer's * report would otherwise be chunked. * * The requirement reaches only an exchange provider that resolves a session per interaction. One * bound to a fixed session — `DedicatedChannelExchangeProvider`, which commissioning and the * deprecated `InteractionClient` use — sends on the session it holds, whatever its transport. * * @see {@link MatterSpecification.v161.Core} § 4.15 */ largeMessage?: boolean; } //# sourceMappingURL=ClientRequest.d.ts.map