/**
 * عميل واتساب — WhatsApp Cloud API v21.0 Client
 * يتعامل مع جميع عمليات إرسال الرسائل وتحميل الوسائط
 */
import type { WhatsAppAPIResponse, WhatsAppTemplateComponent, DownloadedMedia } from './types.js';
export declare class WhatsAppAPIError extends Error {
    readonly statusCode: number;
    readonly responseBody: string;
    constructor(message: string, statusCode: number, responseBody: string);
}
export declare class WhatsAppClient {
    private phoneNumberId;
    constructor(phoneNumberId?: string);
    private get messagesEndpoint();
    /**
     * إرسال رسالة عبر API
     */
    private sendMessage;
    sendText(to: string, text: string): Promise<WhatsAppAPIResponse>;
    sendImage(to: string, imageUrl: string, caption?: string): Promise<WhatsAppAPIResponse>;
    sendDocument(to: string, docUrl: string, filename: string, caption?: string): Promise<WhatsAppAPIResponse>;
    sendAudio(to: string, audioUrl: string): Promise<WhatsAppAPIResponse>;
    sendTemplate(to: string, templateName: string, components?: WhatsAppTemplateComponent[], languageCode?: string): Promise<WhatsAppAPIResponse>;
    sendButtons(to: string, bodyText: string, buttons: Array<{
        id: string;
        title: string;
    }>): Promise<WhatsAppAPIResponse>;
    sendList(to: string, bodyText: string, sections: Array<{
        title?: string;
        rows: Array<{
            id: string;
            title: string;
            description?: string;
        }>;
    }>, buttonText?: string): Promise<WhatsAppAPIResponse>;
    markAsRead(messageId: string): Promise<void>;
    /**
     * Mark inbound as read AND show "typing..." to the customer.
     * Meta's WhatsApp Cloud API auto-clears the typing state after ~25s OR on
     * the next outbound message — whichever first. So we send this once when
     * the agent starts processing, and our send-message at the end clears it.
     * Errors are non-fatal — typing is a UX nicety, not core flow.
     */
    markAsReadAndShowTyping(messageId: string): Promise<void>;
    /**
     * تحميل ملف وسائط من واتساب
     * الخطوة 1: الحصول على URL من media ID
     * الخطوة 2: تحميل الملف الفعلي
     */
    downloadMedia(mediaId: string): Promise<DownloadedMedia>;
    sendReaction(to: string, messageId: string, emoji: string): Promise<WhatsAppAPIResponse>;
}
export declare const whatsappClient: WhatsAppClient;
//# sourceMappingURL=client.d.ts.map