/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Observable } from "@matter/general"; import { DatatypeModel } from "@matter/model"; import { ClientSubscription, Subscribe } from "@matter/protocol"; import { EventNumber } from "@matter/types"; import { ClientNetworkRuntime } from "./ClientNetworkRuntime.js"; import { NetworkBehavior } from "./NetworkBehavior.js"; export declare class NetworkClient extends NetworkBehavior { #private; internal: NetworkClient.Internal; readonly state: NetworkClient.State; readonly events: NetworkClient.Events; initialize(): void; startup(): Promise; /** * Returns if we actually have an active and established subscription * When a Sustained subscription is used we return the active value, otherwise we know when the subscription instance * is set. */ get subscriptionActive(): any; [Symbol.asyncDispose](): Promise; /** * Define logical schema for fields that should persist. */ static readonly schema: DatatypeModel; } export declare namespace NetworkClient { class Internal extends NetworkBehavior.Internal { runtime?: ClientNetworkRuntime; /** * The active default subscription. */ activeSubscription?: ClientSubscription; /** * Indicates the node is newly commissioned. * * When newly commissioned we perform a one-time read before returning from {@link NetworkClient#startup} * (regardless of autoSubscribe, unless {@link NetworkClient.State.autoStateInitialize} is false). This * ensures we have a complete snapshot of the node's state when commissioning logic is complete. */ isNewlyCommissioned: boolean; } class State extends NetworkBehavior.State { /** * This subscription defines the default set of attributes and events to which the node will automatically * subscribe when started, if autoSubscribe is true. Alternatively, also just Subscribe.Options can be provided * to adjust chosen default subscription parameters (see below). * * The default subscription is a wildcard for all attributes of the node. You can set to undefined or filter * the fields and values but only values selected by this subscription will update automatically. * * The default subscription updates automatically if you change this property. */ defaultSubscription?: Subscribe | Subscribe.Options; /** * Represents the current operational network state of the node. When true the node is enabled and operational. * When false the node is disabled and not operational. * * This state can be changed at any time to enable or disable the node. */ isDisabled: boolean; /** * If true, automatically subscribe to the provided default subscription (or all attributes and events) when * the node is started. If false, do not automatically subscribe. * * The subscription will activate or deactivate automatically if you change this property. * * Newly commissioned nodes default to true. */ autoSubscribe: boolean; /** * When false, skip the one-time read a newly-commissioned node performs to initialize its state. * Undefined or true performs the read. */ autoStateInitialize?: boolean; /** * The highest event number seen from this node for the default read/subscription. */ maxEventNumber: EventNumber; /** * Per-peer transport preference override. * If not set, inherits from NetworkServer.transportPreference. */ transportPreference?: "tcp" | "udp"; } class Events extends NetworkBehavior.Events { autoSubscribe$Changed: Observable<[value: boolean, oldValue: boolean], void>; defaultSubscription$Changed: Observable<[value: Subscribe | undefined, oldValue: Subscribe | undefined], void>; subscriptionStatusChanged: Observable<[isActive: boolean], void>; subscriptionAlive: Observable<[], void>; } } //# sourceMappingURL=NetworkClient.d.ts.map