/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { CommissionableDevice } from "#common/Scanner.js";
import { NodeSession } from "#session/NodeSession.js";
import { Duration, ServerAddress } from "@matter/general";
/**
 * Attempts PASE establishments in parallel across all provided device candidates, returning the first successful
 * session.
 *
 * All candidates come from {@link CommissioningConnection.Options.devices} and are launched immediately in
 * parallel.  This is used when addresses are already known (e.g. from a prior mDNS discovery or a
 * pre-configured address list).
 *
 * A PASE attempt is launched for each (device, address) candidate, so a single device may have multiple concurrent
 * attempts if it was discovered at multiple addresses.  If an attempt fails with a credential error the device is
 * permanently dropped.  If it fails with a transient network/timeout error the remaining addresses for that device
 * are still in-flight.  The process completes when one session is established, all candidates are exhausted, or the
 * overall timeout fires.
 *
 * When the first PASE session is established the abort signal passed to
 * {@link CommissioningConnection.Options.establishSession} fires on all remaining in-flight attempts, allowing
 * them to cancel cleanly (e.g. by sending an InvalidParam status to the device to prevent a 60-second pairing
 * lockout).
 */
export declare function CommissioningConnection(options: CommissioningConnection.Options): Promise<CommissioningConnection.Result>;
export declare namespace CommissioningConnection {
    interface Options {
        /** Commissioning candidates to attempt PASE with. */
        devices: CommissionableDevice[];
        /** Overall timeout for the entire connection attempt. */
        timeout: Duration;
        /**
         * Establishes a PASE session for the given candidate.  The provided {@link AbortSignal} fires when the
         * overall timeout expires or when another candidate wins the race first.  Implementations should respect the
         * signal and abort cleanly (e.g. by sending an InvalidParam status to prevent a 60-second device lockout).
         */
        establishSession: (address: ServerAddress, device: CommissionableDevice, signal: AbortSignal) => Promise<NodeSession>;
        /**
         * An external abort signal.  When fired, terminates all in-flight PASE attempts immediately.
         */
        externalAbort?: AbortSignal;
    }
    interface Result {
        session: NodeSession;
        discoveryData: CommissionableDevice;
    }
}
//# sourceMappingURL=CommissioningConnection.d.ts.map