import type { ITransportMessageMeta } from './ITransportMessageMeta';
/**
 * Transport message handler.
 * Payload is `unknown` at the transport layer - use type guards or casts
 * to narrow to specific protocol interfaces (RequestReplyEnvelope, etc.).
 */
export type TransportHandler = (payload: unknown, meta: ITransportMessageMeta) => void | Promise<void>;
/**
 * Wire topic information for debugging transparency.
 * Allows inspection of actual topics sent on the wire vs app-level topics.
 */
export interface IWireTopicInfo {
    /** The application-level topic (what the component uses) */
    appTopic: string;
    /** The actual wire topic (what goes on the transport) */
    wireTopic: string;
    /** Topic prefix if any (e.g., "anonymous/session-123/") - legacy mode */
    prefix: string;
    /** Root if session isolation is active */
    root?: string;
    /** @deprecated Use `root`. */
    realm?: string;
    /** Session ID if session isolation is active (legacy) */
    sessionId?: string;
    /** Principal for MXTOPIC-1 mode */
    principal?: string;
    /** Exec token for MXTOPIC-1 mode */
    execToken?: string;
}
/**
 * Scheme‑specific transport adapter.
 *
 * Used for both local (in‑proc) and remote messaging.
 * Payload types are `unknown` at this layer - protocol code should
 * cast to specific interfaces (RequestReplyEnvelope, ChildAddedPayload, etc.).
 */
export interface ITransportAdapter {
    /**
     * DNS root identity for this transport (e.g., 'com.nimbletec.richard.santomauro').
     * Used for cross-root request routing decisions.
     */
    readonly root: string;
    /** @deprecated Alias for `root`. Use `root` instead. */
    readonly realm?: string;
    publish(topic: string, payload?: unknown): void;
    subscribe(topic: string, handler: TransportHandler): () => void;
    /**
     * Get wire topic info for debugging transparency.
     * Returns the actual topic that will be used on the wire,
     * including any prefix transformations applied by the transport.
     */
    getWireTopicInfo?(topic: string): IWireTopicInfo;
    /**
     * Get the topic prefix (if any).
     * For transports with session isolation, this includes root/session.
     */
    readonly topicPrefix?: string;
    /**
     * Return the underlying client instance (NATS, federation peer, etc.).
     */
    getUnderlyingClient(): unknown;
    /**
     * Close transport resources and network connections.
     */
    disconnect(): Promise<void>;
}
//# sourceMappingURL=ITransportAdapter.d.ts.map