/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { PeerAddress } from "#peer/PeerAddress.js";
import { ExchangeManager } from "#protocol/ExchangeManager.js";
import { SessionManager } from "#session/SessionManager.js";
import { AsyncObservable, BasicSet, DnssdNames, Environment, Environmental, ImmutableSet, Lifetime, ObservableSet, RetrySchedule } from "@matter/general";
import { NetworkProfiles } from "./NetworkProfile.js";
import { Peer } from "./Peer.js";
import { PeerConnection } from "./PeerConnection.js";
import { PeerDescriptor } from "./PeerDescriptor.js";
import { PeerTimingParameters } from "./PeerTimingParameters.js";
/**
 * Interfaces {@link PeerSet} with other components.
 */
export interface PeerSetContext {
    lifetime: Lifetime.Owner;
    sessions: SessionManager;
    names: DnssdNames;
    networks: NetworkProfiles;
    connectionRetries?: RetrySchedule;
    timing?: PeerTimingParameters;
    handleError?: PeerConnection.Context["handleError"];
}
/**
 * Manages operational connections to peers on shared fabric.
 */
export declare class PeerSet implements ImmutableSet<Peer>, ObservableSet<Peer> {
    #private;
    constructor(context: PeerSetContext);
    set exchanges(exchanges: ExchangeManager | undefined);
    get added(): import("@matter/general").Observable<[Peer], void>;
    get deleted(): import("@matter/general").Observable<[Peer], void>;
    get empty(): import("@matter/general").ObservableValue<[boolean], void>;
    get disconnected(): AsyncObservable<[peer: Peer], void>;
    /**
     * Unconditional get.
     *
     * Creates the peer if not already present.
     */
    for(address: PeerAddress): Peer;
    has(item: PeerAddress | PeerDescriptor | Peer): boolean;
    get size(): number;
    find(predicate: (item: Peer) => boolean | undefined): Peer | undefined;
    filter(predicate: (item: Peer) => boolean | undefined): Peer[];
    map<T>(mapper: (item: Peer) => T): T[];
    [Symbol.iterator](): SetIterator<Peer>;
    static [Environmental.create](env: Environment): PeerSet;
    get peers(): BasicSet<Peer, Peer>;
    get networks(): NetworkProfiles;
    get timing(): Partial<PeerTimingParameters>;
    set timing(timing: Partial<PeerTimingParameters>);
    set handleError(handler: PeerConnection.Context["handleError"]);
    /**
     * Retrieve a peer by address.
     */
    get(peer: PeerAddress | PeerDescriptor): Peer | undefined;
    /**
     * Terminate any active peer networking operations.
     *
     * Also sets {@link exchanges} to undefined to prevent future connections.
     */
    disconnect(): Promise<void>;
    close(): Promise<void>;
    addKnownPeer(descriptor: PeerDescriptor): Peer;
}
//# sourceMappingURL=PeerSet.d.ts.map