/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import type { ClientInteraction } from "#action/client/ClientInteraction.js";
import type { NodeProtocol } from "#action/protocols.js";
import { PeerAddress } from "#peer/PeerAddress.js";
import type { ExchangeProvider } from "#protocol/ExchangeProvider.js";
import type { NodeSession } from "#session/NodeSession.js";
import { SessionParameters } from "#session/SessionParameters.js";
import { AsyncObservable, BasicSet, DnssdNames, Duration, Identity, IpService, Lifetime } from "@matter/general";
import { BasicInformation } from "@matter/types/clusters/basic-information";
import type { NetworkProfiles } from "./NetworkProfile.js";
import { PeerConnection } from "./PeerConnection.js";
import { PeerDescriptor } from "./PeerDescriptor.js";
import { PeerTimingParameters } from "./PeerTimingParameters.js";
import type { PhysicalDeviceProperties } from "./PhysicalDeviceProperties.js";
/**
 * A node on a fabric we are a member of.
 */
export declare class Peer {
    #private;
    constructor(descriptor: PeerDescriptor, context: Peer.Context);
    /**
     * Emits when metadata changes.
     */
    get updated(): AsyncObservable<[peer: Peer], void>;
    get lifetime(): Lifetime;
    get fabric(): import("../index.js").Fabric;
    get interaction(): ClientInteraction | undefined;
    set interaction(interaction: ClientInteraction | undefined);
    get protocol(): NodeProtocol | undefined;
    set protocol(protocol: NodeProtocol | undefined);
    get physicalProperties(): PhysicalDeviceProperties | undefined;
    set physicalProperties(props: PhysicalDeviceProperties | undefined);
    get basicInformation(): Peer.BasicInformation | undefined;
    get limits(): {
        caseSessionsPerFabric: number;
        subscriptionsPerFabric: number;
    };
    get address(): PeerAddress;
    get descriptor(): PeerDescriptor;
    get sessions(): BasicSet<NodeSession, NodeSession>;
    get subscriptions(): import("../index.js").Subscription[];
    get exchangeProvider(): ExchangeProvider;
    get service(): IpService;
    /**
     * "Best guess" {@link SessionParameters} for the peer based on available information.
     */
    get sessionParameters(): SessionParameters;
    get network(): import("./NetworkProfile.js").NetworkProfile;
    /**
     * Time that node has been unreachable.
     *
     * If we are actively attempting to connect to the peer, this is the time since the connection process started.
     * Otherwise it is zero.
     */
    get timeOffline(): Duration;
    /**
     * Obtain a session with the peer, establishing anew as necessary.
     */
    connect(options?: Peer.ConnectOptions): Promise<import("../index.js").GroupSession | NodeSession>;
    /**
     * Kick the connection process.
     *
     * Aborts the current CASE handshake exchange and restarts it from scratch with a fresh MRP
     * backoff. Rate-limited; repeated calls within {@link PeerTimingParameters.kickRestartCooldown}
     * are suppressed.
     */
    kick(): void;
    /**
     * Abort any outstanding connection attempts.
     */
    disconnect(): Promise<void>;
    /**
     * Permanently forget the peer.
     */
    delete(): Promise<void>;
    /**
     * Close the peer without removing persistent state.
     */
    close(): Promise<void>;
    toString(): string;
    get hasSession(): boolean;
    get newestSession(): NodeSession | undefined;
}
export declare namespace Peer {
    interface Context extends PeerConnection.Context {
        names: DnssdNames;
        networks: NetworkProfiles;
        closed(peer: Peer): void;
    }
    interface BasicInformation extends Identity<{
        readonly [N in keyof BasicInformation.Attributes]?: BasicInformation.Attributes[N];
    }> {
    }
    interface ConnectOptions {
        /**
         * Aborts the connection attempt (underlying connection however may continue).
         */
        abort?: AbortSignal;
        /**
         * Network identifier used for timing parameters.
         */
        network?: string;
        /**
         * A timeout relative to beginning of connection process.
         *
         * If the peer is already connecting, connection time is reduced by this amount.
         */
        connectionTimeout?: Duration;
        /**
         * If a connection is ongoing, kicks the process to increase MRP responsiveness.
         *
         * If true, {@link connectionTimeout} is not reduced if already connecting.
         */
        kick?: boolean;
        /**
         * Per-call overrides for timing parameters.
         *
         * Merged on top of the global {@link PeerSet.timing} for this connection only.
         * Other concurrent or future connections are not affected.
         *
         * Note: if a connection process is already in progress for this peer, these overrides are not applied to the
         * ongoing attempt.
         */
        timing?: Partial<PeerTimingParameters>;
        /**
         * Per-call error handler, overrides {@link PeerConnection.Context.handleError} for this connection only.
         *
         * Note: if a connection process is already in progress for this peer, this handler is not applied to the
         * ongoing attempt.
         */
        handleError?: (error: Error) => Duration | void;
    }
}
//# sourceMappingURL=Peer.d.ts.map