/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { AddressStatus, ServerAddress } from "./ServerAddress.js";
/**
 * A set of server addresses ordered by a comparator.
 */
export interface ServerAddressSet<T extends ServerAddress> {
    /**
     * Add an address.
     *
     * If the address alreay exists, returns the existing address to facilitate comparison by value.  If not, returns
     * the input address.
     */
    add(address: T): T;
    /**
     * Delete an address.
     */
    delete(address: T): boolean;
    /**
     * Replace the stored addresses.
     */
    replace(newAddresses: Iterable<T>): void;
    /**
     * Test for existence of address.
     */
    has(address: T): boolean;
    /**
     * The number of addresses.
     */
    size: number;
    /**
     * Iterate.
     *
     * If you replace addresses during iteration only addresses not already produced will be covered by remaining
     * iterations.
     */
    [Symbol.iterator](): Iterator<T>;
}
/**
 * Create a new {@link ServerAddressSet}.
 */
export declare function ServerAddressSet<T extends ServerAddress>(initial?: Iterable<T>, comparator?: typeof ServerAddressSet.compareDesirability): ServerAddressSet<T>;
export declare namespace ServerAddressSet {
    interface Comparator<T extends ServerAddress = ServerAddress> {
        (addr1: T, addr2: T): number;
    }
    /**
     * Update a list of addresses with health information from another list.
     */
    function copyHealth<T extends ServerAddress>(targetAddresses: Iterable<T>, sourceAddresses: Iterable<T>): T[];
    /**
     * Compare the "desirability" of two addresses for communication.
     */
    function compareDesirability(a: ServerAddress, b: ServerAddress): number;
    /**
     * Compare the health of two addresses.
     *
     * Returns a negative number if a is healthier, positive if b is healthier and 0 if assessment is neutral.
     */
    function compareHealth(a: AddressStatus, b: AddressStatus): number;
}
//# sourceMappingURL=ServerAddressSet.d.ts.map