import { BasePlatformAdapter, MessageEvent, ProcessingOutcome, SendResult } from './platform-base.js'; import type { PlatformConfig } from './platform-base.js'; export interface WhatsAppConfig extends PlatformConfig { phoneNumberId?: string; accessToken?: string; webhookVerifyToken?: string; webhookSecret?: string; allowedNumbers?: string[]; businessApiUrl?: string; } interface WhatsAppMessage { id: string; from: string; type: 'text' | 'image' | 'audio' | 'video' | 'document' | 'location' | 'sticker' | 'button' | 'interactive'; timestamp: string; text?: { body: string; }; image?: { id: string; mime_type: string; caption?: string; }; audio?: { id: string; mime_type: string; }; video?: { id: string; mime_type: string; caption?: string; }; document?: { id: string; mime_type: string; filename?: string; caption?: string; }; button?: { payload: string; text: string; }; interactive?: { type: string; button_reply?: { id: string; title: string; }; }; } interface WhatsAppWebhookPayload { object: string; entry: Array<{ id: string; changes: Array<{ value: { messaging_product: string; metadata: { phone_number_id: string; }; contacts?: Array<{ profile: { name: string; }; wa_id: string; }>; messages?: WhatsAppMessage[]; statuses?: Array<{ id: string; status: string; recipient_id: string; }>; }; field: string; }>; }>; } declare const MAX_MESSAGE_LENGTH = 4096; export declare class WhatsAppChannel extends BasePlatformAdapter { private phoneNumberId; private accessToken; private webhookVerifyToken; private webhookSecret; private allowedNumbers; private businessApiUrl; private seenMessages; constructor(config: WhatsAppConfig); connect(): Promise; disconnect(): Promise; verifyWebhook(mode: string, token: string, challenge: string): string | null; verifySignature(body: string, signature: string): boolean; handleWebhookPayload(payload: WhatsAppWebhookPayload): Promise; private processMessage; private getMediaUrl; private graphApi; private chunkContent; send(chatId: string, content: string, _replyTo?: string, _metadata?: Record): Promise; editMessage(_chatId: string, messageId: string, _content: string, _finalize?: boolean): Promise; sendTyping(chatId: string, _metadata?: Record): Promise; stopTyping(_chatId: string): Promise; sendImage(chatId: string, imageUrl: string, caption?: string, _replyTo?: string, _metadata?: Record): Promise; sendAnimation(chatId: string, animationUrl: string, caption?: string, replyTo?: string, metadata?: Record): Promise; sendTemplate(chatId: string, templateName: string, languageCode: string, components?: unknown[]): Promise; sendReaction(chatId: string, messageId: string, emoji: string): Promise; getChatInfo(chatId: string): Promise>; onProcessingComplete(_event: MessageEvent, _outcome: ProcessingOutcome): void; } export { MAX_MESSAGE_LENGTH }; //# sourceMappingURL=whatsapp.d.ts.map