/**
 * Local CLI MQTT Client for Awake Lambda Development
 *
 * Provides MQTT over WebSockets connectivity to AWS IoT Core with:
 * - SigV4 authentication via aws-iot-device-sdk-v2
 * - Real-time message subscription for incoming requests
 * - Automatic reconnection with exponential backoff
 * - Proxy support (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)
 * - Message idempotency tracking
 *
 * @module bin/commands/dev/mqtt-client
 *
 * @see Requirements 2.1, 4.2, 4.3, 4.4, 4.5, 11.2, 11.3, 11.4
 */
import { mqtt } from 'aws-iot-device-sdk-v2';
import type { RuntimeAwakeRequest, RuntimeAwakeResponse } from '../../../lib/runtime-web/runtime-awake';
/**
 * Connection state for the MQTT client.
 */
export type MqttConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
/**
 * Configuration for the Local CLI MQTT client.
 */
export interface LocalMqttClientConfig {
    readonly iotEndpoint: string;
    readonly region: string;
    readonly profile?: string;
    readonly devId: string;
    readonly payloadBucketName: string;
    readonly qos?: mqtt.QoS;
    readonly initialReconnectDelayMs?: number;
    readonly maxReconnectDelayMs?: number;
    readonly idempotencyTtlMs?: number;
}
export type RequestMessageHandler = (request: RuntimeAwakeRequest) => Promise<void>;
export type ConnectionStateHandler = (state: MqttConnectionState, error?: Error) => void;
/**
 * Calculate exponential backoff delay.
 */
export declare function calculateBackoffDelay(attempt: number, initialDelayMs?: number, maxDelayMs?: number): number;
/**
 * Check if a host should bypass proxy based on NO_PROXY environment variable.
 */
export declare function shouldBypassProxy(host: string, noProxy?: string): boolean;
/**
 * Get proxy configuration from environment variables.
 */
export declare function getProxyConfig(targetHost: string): string | undefined;
/**
 * Local CLI MQTT Client for Awake Lambda Development.
 *
 * Connects to AWS IoT Core via MQTT over WebSockets with SigV4 authentication.
 * Uses aws-iot-device-sdk-v2 for real-time message subscription.
 *
 * **Architecture**:
 * - Subscribes to `runtime/dev/{devId}/request/#` for incoming requests
 * - Writes responses to S3 at `runtime-awake/{devId}/{requestId}/response`
 * - Proxy Lambda polls S3 for responses (ResponseWaiter pattern)
 */
export declare class LocalMqttClient {
    private readonly config;
    private readonly qos;
    private readonly initialReconnectDelayMs;
    private readonly maxReconnectDelayMs;
    private readonly idempotencyTtlMs;
    private connection;
    private readonly s3Client;
    private connectionState;
    private reconnectAttempt;
    private reconnectTimer;
    private readonly processedRequests;
    private idempotencyCleanupTimer;
    private messageHandler;
    private stateHandler;
    private readonly subscribedTopics;
    private isRunning;
    constructor(config: LocalMqttClientConfig);
    getConnectionState(): MqttConnectionState;
    getDevId(): string;
    getRequestTopicPattern(): string;
    getResponseS3Key(requestId: string): string;
    onMessage(handler: RequestMessageHandler): void;
    onStateChange(handler: ConnectionStateHandler): void;
    connect(): Promise<void>;
    private createMqttConnection;
    private setupConnectionHandlers;
    private handleIncomingMessage;
    disconnect(): Promise<void>;
    subscribe(topic: string): Promise<void>;
    publishResponse(requestId: string, response: RuntimeAwakeResponse): Promise<void>;
    isRequestProcessed(requestId: string): boolean;
    markRequestProcessed(requestId: string): void;
    getProcessedRequestCount(): number;
    scheduleReconnect(): void;
    private reconnect;
    private setConnectionState;
    private startIdempotencyCleanup;
    private cleanupProcessedRequests;
    simulateConnectionLoss(): void;
}
