/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Duration, Environment, Environmental, MatterError, Semaphore } from "@matter/general";
import { Peer } from "./Peer.js";
/**
 * Thrown when a named network profile does not exist.
 */
export declare class UnknownNetworkProfileError extends MatterError {
}
export interface ConcreteNetworkProfile {
    /**
     * The ID of the NetworkProfile used to register with {@link NetworkProfiles}.
     */
    id: string;
    /**
     * A {@link Semaphore} that limits communications for this particular profile.
     */
    semaphore: Semaphore;
}
/**
 * A single logical Matter networking segment.
 *
 * A "network profile" is a logical grouping of nodes that share rate limits.  By default matter.js selects a network
 * based on medium, falling back to {@link NetworkProfiles.conservative} if the medium is unknown.
 *
 * TODO - record latency and packet loss to support dynamic rate limits
 */
export interface NetworkProfile extends ConcreteNetworkProfile {
    /**
     * An additional profile that applies only to the establishment of new CASE sessions.
     */
    connect?: ConcreteNetworkProfile;
    /**
     * An additional profile that applies only to address probe reads.
     */
    probeAddress?: ConcreteNetworkProfile;
}
/**
 * Controls how we interact with peers based on the network in which the peer resides.
 */
export declare class NetworkProfiles {
    #private;
    constructor(options?: NetworkProfiles.Options);
    set defaults(options: NetworkProfiles.PartialOptions);
    static [Environmental.create](env: Environment): NetworkProfiles;
    select(peer: Peer, id?: string): NetworkProfile;
    /**
     * Retrieve the named network profile.
     *
     * @param id one of the standard {@link NetworkProfiles.Templates} or any previously configured identifier
     */
    get(id: string): NetworkProfile;
    configure(id: string, limits: NetworkProfiles.Limits): NetworkProfile;
    forPeer(peer: Peer): NetworkProfile;
}
export declare namespace NetworkProfiles {
    interface Options extends Partial<Templates> {
    }
    /**
     * Like {@link Options} but allows partially specifying individual profiles, including nested connect limits.
     */
    type PartialOptions = {
        [K in keyof Templates]?: Partial<Omit<Limits, "connect" | "probeAddress">> & {
            connect?: Partial<ConcreteLimits>;
            probeAddress?: Partial<ConcreteLimits>;
        };
    };
    interface ConcreteLimits {
        /**
         * Maximum number of concurrent exchanges.
         */
        exchanges: number;
        /**
         * Delay between new exchanges.
         */
        delay?: Duration;
        /**
         * Maximum timeout for one exchange before trying the next in any case.
         */
        timeout?: Duration;
    }
    /**
     * Parameters that control exchange throttling for a specific medium.
     */
    interface Limits extends ConcreteLimits {
        /**
         * Overrides specifically for establishing new sessions.
         *
         * If present, any values here act as limits specifically for CASE session establishment.
         */
        connect?: ConcreteLimits;
        /**
         * Overrides specifically for address probe reads.
         *
         * If present, any values here act as limits specifically for probing peer addresses.
         */
        probeAddress?: ConcreteLimits;
    }
    /**
     * Standard profiles, selected automatically based on transfer medium.
     */
    interface Templates {
        /**
         * Limit for "fast" networks.
         *
         * We use this value for ethernet and WiFi.
         */
        fast: Limits;
        /**
         * Limit for thread networks, by channel.
         *
         * Each channel has a separate network, plus an additional one for devices that do not report their channel.
         * If the device indicates thread is disabled then we use {@link fast}.
         */
        thread: Limits;
        /**
         * Conservative limits used as the base for constrained networks.
         */
        conservative: Limits;
        /**
         * Limits for peers with unknown physical properties.
         *
         * Defaults to {@link conservative}.  Note that this template is automatically overwritten at startup for
         * device nodes based on the node's network capabilities.  Manually setting this may have no effect.  To
         * adjust limits, override {@link fast}, {@link thread} or {@link conservative} instead.
         */
        unknown: Limits;
        /**
         * Limit for "unlimited" networks.
         *
         * Interactions only use this profile if you specify explicitly.
         */
        unlimited: Limits;
    }
    /**
     * The fallback used for unknown network IDs or mediums.
     */
    const conservative: Limits;
    const defaults: Templates;
}
//# sourceMappingURL=NetworkProfile.d.ts.map