import type { LTEvent, LTEventAdapter } from '../../types';
/**
 * NATS event adapter — publish AND subscribe.
 *
 * Publishes LTEvent payloads as JSON to NATS subjects
 * following the pattern: `{subjectPrefix}.{event.type}`
 *
 * When a CallbackEventAdapter is bridged via `setCallbackBridge()`,
 * this adapter also subscribes to `{subjectPrefix}.>` and forwards
 * events from other containers to the local callback adapter.
 * An `_originId` field prevents the publishing container from
 * re-dispatching its own events.
 *
 * Usage:
 * ```typescript
 * import { eventRegistry, NatsEventAdapter } from '@hotmeshio/long-tail';
 *
 * eventRegistry.register(new NatsEventAdapter());
 * await eventRegistry.connect();
 * ```
 */
export declare class NatsEventAdapter implements LTEventAdapter {
    private nc;
    private sub;
    private url;
    private _wsUrl;
    private _wsProxyTarget;
    private _wsProxyBasePath;
    private subjectPrefix;
    private token?;
    private originId;
    private callbackAdapter;
    constructor(options?: {
        url?: string;
        wsUrl?: string;
        wsProxy?: string;
        subjectPrefix?: string;
        token?: string;
    });
    /**
     * Public NATS WebSocket URL for browser connections.
     * When a wsProxy is configured, this can be set dynamically
     * via `setWsUrl()` once the server's public address is known.
     */
    get wsUrl(): string | null;
    /** Set the browser-facing WebSocket URL (called by proxy setup). */
    setWsUrl(url: string): void;
    /** Internal NATS WS target for the proxy to bridge to (e.g. ws://nats:9222). */
    get wsProxyTarget(): string | null;
    /** BasePath the proxy is mounted at (e.g. /longtail). Set by LTExpressAdapter. */
    get wsProxyBasePath(): string;
    /** Set the proxy basePath (called by LTExpressAdapter.attachServer). */
    setWsProxyBasePath(basePath: string): void;
    /** NATS auth token for browser connections. */
    get authToken(): string | null;
    /**
     * Bridge NATS → local callback adapter for cross-container dispatch.
     * Part of the LTEventAdapter contract. Call before `connect()`.
     */
    setCallbackBridge(adapter: LTEventAdapter): void;
    connect(): Promise<void>;
    publish(event: LTEvent): Promise<void>;
    disconnect(): Promise<void>;
}
