import type { RuntimeAwakeResponse } from '../../../lib/runtime-web/runtime-awake';
/**
 * Configuration for the MQTT client.
 */
export interface MqttClientConfig {
    /** AWS IoT Core endpoint */
    readonly iotEndpoint: string;
    /** AWS region */
    readonly region: string;
    /** QoS level for messages (default: 1) */
    readonly qos?: 0 | 1;
}
/**
 * Message handler callback type.
 */
export type MessageHandler = (topic: string, payload: Buffer) => void;
/**
 * Response handler callback type.
 */
export type ResponseHandler = (requestId: string, response: RuntimeAwakeResponse) => void;
/**
 * MQTT Client for AWS IoT Core communication.
 *
 * Handles publish/subscribe operations for Awake Lambda Development.
 * Uses AWS SDK v3 IoT Data Plane client for publishing.
 *
 * Note: For Lambda-side operations, we primarily use publish.
 * Subscribe functionality is used by the Local CLI.
 *
 * @see Requirements 2.1, 2.2
 */
export declare class MqttClient {
    private readonly config;
    private readonly iotClient;
    private readonly qos;
    /**
     * Create a new MQTT client.
     *
     * @param config - MQTT client configuration
     */
    constructor(config: MqttClientConfig);
    /**
     * Publish a message to an MQTT topic.
     *
     * @param topic - MQTT topic to publish to
     * @param payload - Message payload (will be JSON stringified if object)
     * @returns Promise that resolves when publish is complete
     *
     * @see Requirements 2.1
     */
    publish(topic: string, payload: unknown): Promise<void>;
    /**
     * Publish a message with retry logic.
     *
     * @param topic - MQTT topic to publish to
     * @param payload - Message payload
     * @param maxRetries - Maximum number of retries (default: 1)
     * @param retryDelayMs - Delay between retries in ms (default: 100)
     * @returns Promise that resolves when publish is complete
     *
     * @see Requirements 1.7
     */
    publishWithRetry(topic: string, payload: unknown, maxRetries?: number, retryDelayMs?: number): Promise<void>;
    /**
     * Get the IoT endpoint.
     *
     * @returns IoT endpoint URL
     */
    getEndpoint(): string;
    /**
     * Delay helper for retry logic.
     *
     * @param ms - Milliseconds to delay
     */
    private delay;
}
/**
 * Response waiter for Proxy Lambda.
 *
 * Manages pending response promises and handles response correlation
 * by requestId. Used by ProxyLambda to wait for responses from Local CLI.
 *
 * @see Requirements 2.6
 */
export declare class ResponseWaiter {
    private readonly pendingResponses;
    /**
     * Wait for a response with the given requestId.
     *
     * @param requestId - Request ID to wait for
     * @param timeoutMs - Timeout in milliseconds
     * @returns Promise that resolves with the response
     */
    waitForResponse(requestId: string, timeoutMs: number): Promise<RuntimeAwakeResponse>;
    /**
     * Resolve a pending response.
     *
     * Called when a response message is received.
     *
     * @param requestId - Request ID
     * @param response - Response message
     * @returns True if response was resolved, false if no pending request
     */
    resolveResponse(requestId: string, response: RuntimeAwakeResponse): boolean;
    /**
     * Reject a pending response with an error.
     *
     * @param requestId - Request ID
     * @param error - Error to reject with
     * @returns True if response was rejected, false if no pending request
     */
    rejectResponse(requestId: string, error: Error): boolean;
    /**
     * Check if there's a pending response for the given requestId.
     *
     * @param requestId - Request ID to check
     * @returns True if there's a pending response
     */
    hasPending(requestId: string): boolean;
    /**
     * Get the number of pending responses.
     *
     * @returns Number of pending responses
     */
    getPendingCount(): number;
    /**
     * Cancel all pending responses.
     *
     * @param reason - Reason for cancellation
     */
    cancelAll(reason: string): void;
}
/**
 * Parse a response topic to extract the requestId.
 *
 * @param topic - MQTT topic (format: runtime/dev/<devId>/response/<requestId>)
 * @returns Request ID or null if topic doesn't match expected format
 */
export declare function parseResponseTopic(topic: string): string | null;
/**
 * Parse a request topic to extract devId and requestId.
 *
 * @param topic - MQTT topic (format: runtime/dev/<devId>/request/<requestId>)
 * @returns Object with devId and requestId, or null if topic doesn't match
 */
export declare function parseRequestTopic(topic: string): {
    devId: string;
    requestId: string;
} | null;
