import { FaultTolerance } from '@libp2p/interface';
import type { Libp2pEvents, ComponentLogger, Connection, Metrics, Startable, Listener, Transport, Upgrader } from '@libp2p/interface';
import type { AddressManager, TransportManager, TransportManagerDialOptions } from '@libp2p/interface-internal';
import type { Multiaddr } from '@multiformats/multiaddr';
import type { TypedEventTarget } from 'main-event';
export interface TransportManagerInit {
    faultTolerance?: FaultTolerance;
}
export interface DefaultTransportManagerComponents {
    metrics?: Metrics;
    addressManager: AddressManager;
    upgrader: Upgrader;
    events: TypedEventTarget<Libp2pEvents>;
    logger: ComponentLogger;
}
export declare class DefaultTransportManager implements TransportManager, Startable {
    private readonly log;
    private readonly components;
    private readonly transports;
    private readonly listeners;
    private readonly faultTolerance;
    private started;
    constructor(components: DefaultTransportManagerComponents, init?: TransportManagerInit);
    readonly [Symbol.toStringTag] = "@libp2p/transport-manager";
    /**
     * Adds a `Transport` to the manager
     */
    add(transport: Transport): void;
    isStarted(): boolean;
    start(): void;
    afterStart(): Promise<void>;
    /**
     * Stops all listeners
     */
    stop(): Promise<void>;
    /**
     * Dials the given Multiaddr over it's supported transport
     */
    dial(ma: Multiaddr, options?: TransportManagerDialOptions): Promise<Connection>;
    /**
     * Returns all Multiaddr's the listeners are using
     */
    getAddrs(): Multiaddr[];
    /**
     * Returns all the transports instances
     */
    getTransports(): Transport[];
    /**
     * Returns all the listener instances
     */
    getListeners(): Listener[];
    /**
     * Finds a transport that matches the given Multiaddr
     */
    dialTransportForMultiaddr(ma: Multiaddr): Transport | undefined;
    /**
     * Finds a transport that matches the given Multiaddr
     */
    listenTransportForMultiaddr(ma: Multiaddr): Transport | undefined;
    /**
     * Starts listeners for each listen Multiaddr
     */
    listen(addrs: Multiaddr[]): Promise<void>;
    private ipv6Unsupported;
    /**
     * Removes the given transport from the manager.
     * If a transport has any running listeners, they will be closed.
     */
    remove(key: string): Promise<void>;
    /**
     * Removes all transports from the manager.
     * If any listeners are running, they will be closed.
     *
     * @async
     */
    removeAll(): Promise<void>;
}
//# sourceMappingURL=transport-manager.d.ts.map