/**
 * TransportSelector - Automatic transport selection
 *
 * Selection order by federation mode:
 * - auto: local broker → public broker → in-memory
 * - local: local broker only
 * - public: public broker only
 * - disabled: in-memory only
 */
import type { RootRegistry, RootEndpoint } from './root_registry';
/**
 * Federation mode determines how the realm connects to transports.
 * Duplicated from Matrix-3 core to keep federation package self-contained.
 */
export type FederationMode = 'auto' | 'local' | 'public' | 'disabled';
export type TransportEvent = 'connecting' | 'connected' | 'disconnected' | 'fallback';
export type TransportEventCallback = (event: TransportEvent, endpoint?: RootEndpoint) => void;
export declare class TransportUnavailableError extends Error {
    constructor(root: string, mode: FederationMode);
}
export declare class TransportSelector {
    private _registry;
    private _mode;
    private _probe;
    private _connected;
    private _listeners;
    constructor(_registry: RootRegistry, _mode: FederationMode);
    /**
     * Select the best available transport for a target realm.
     * Creates transport lazily on first call for each realm.
     */
    select(targetRoot: string): Promise<RootEndpoint>;
    /**
     * Subscribe to transport events.
     */
    on(callback: TransportEventCallback): () => void;
    /**
     * Mark transport as disconnected (triggers fallback on next select).
     */
    markDisconnected(root: string): void;
    private _getCandidates;
    private _emit;
}
//# sourceMappingURL=transport_selector.d.ts.map