import { W as WhatsAppProviderAdapter, B as ButtonDef, I as InteractiveOptions, S as SendResult, a as SectionDef, O as OutboundMessage, T as TextOptions, b as TemplateComponent, M as MediaSource, c as MediaMessageOptions, D as DocumentOptions, L as LocationPayload, C as ContactPayload, d as MediaUpload, e as MediaUploadResult, f as MediaUrlResult, g as MediaDownloadResult, h as WebhookEvent, i as Template, j as CreateTemplateInput, k as OtpSendOptions, P as ProviderFeature, l as CreateWhatsAppConfig } from './provider-C49GxNtg.js'; export { A as AudioMessage, m as ClientHooks, n as ClientOptions, o as CloudApiConfig, p as ContactInfo, q as ContactsMessage, r as CurrencyParam, s as Dialog360Config, t as DocumentMessage, u as ImageMessage, v as IncomingAudioMessage, w as IncomingButtonReply, x as IncomingContactsMessage, y as IncomingDocumentMessage, z as IncomingImageMessage, E as IncomingListReply, F as IncomingLocationMessage, G as IncomingMessage, H as IncomingMessageEvent, J as IncomingReactionMessage, K as IncomingStickerMessage, N as IncomingTextMessage, Q as IncomingUnknownMessage, R as IncomingVideoMessage, U as InteractiveButtonMessage, V as InteractiveHeader, X as InteractiveListMessage, Y as LocationMessage, Z as Logger, _ as MediaId, $ as MessageErrorEvent, a0 as MessageId, a1 as MessageStatusEvent, a2 as PhoneNumber, a3 as ProviderConfig, a4 as ProviderName, a5 as RateLimitConfig, a6 as ReactionMessage, a7 as RetryConfig, a8 as SectionRow, a9 as StickerMessage, aa as TemplateButtonDef, ab as TemplateComponentDef, ac as TemplateMessage, ad as TemplateParameter, ae as TextMessage, af as Timestamp, ag as VideoMessage, ah as WatiConfig, ai as WebhookMetadata, aj as noopLogger } from './provider-C49GxNtg.js'; export { CloudApiProvider } from './providers/cloud-api/index.js'; export { Dialog360Provider } from './providers/360dialog/index.js'; export { WatiProvider } from './providers/wati/index.js'; declare class WhatsAppClient { private readonly adapter; /** Which provider is active */ readonly provider: string; /** Message operations */ readonly message: MessageNamespace; /** Media operations */ readonly media: MediaNamespace; /** Webhook operations */ readonly webhook: WebhookNamespace; /** Template operations */ readonly template: TemplateNamespace; /** One-time-password (authentication template) helper */ readonly otp: OtpNamespace; constructor(adapter: WhatsAppProviderAdapter); /** Check if the current provider supports a specific feature */ supports(feature: ProviderFeature): boolean; /** * Release resources held by the client (the rate limiter's pending timer and * any queued waiters). Call when you're done with a client you won't reuse — * e.g. a per-request client on an edge runtime. Safe to call more than once. * * ```ts * const wa = createWhatsApp({ ... }) * try { * await wa.message.text(to, 'hi') * } finally { * wa.destroy() * } * ``` */ destroy(): void; } declare class MessageNamespace { private readonly adapter; /** Interactive message sub-namespace */ readonly interactive: InteractiveNamespace; constructor(adapter: WhatsAppProviderAdapter); /** Send any outbound message (low-level — prefer the typed shorthand methods) */ send(message: OutboundMessage): Promise; /** Send a text message */ text(to: string, body: string, options?: TextOptions): Promise; /** Send a template message */ template(to: string, tmpl: { name: string; language: string; components?: TemplateComponent[]; }): Promise; /** Send an image message */ image(to: string, source: MediaSource, options?: MediaMessageOptions): Promise; /** Send a video message */ video(to: string, source: MediaSource, options?: MediaMessageOptions): Promise; /** Send an audio message */ audio(to: string, source: MediaSource, options?: { replyTo?: string; }): Promise; /** Send a document message */ document(to: string, source: MediaSource, options?: DocumentOptions): Promise; /** Send a sticker message */ sticker(to: string, source: MediaSource, options?: { replyTo?: string; }): Promise; /** Send a location message */ location(to: string, loc: LocationPayload, options?: { replyTo?: string; }): Promise; /** Send contact card(s) */ contacts(to: string, contacts: ContactPayload[], options?: { replyTo?: string; }): Promise; /** Send a reaction to a message */ reaction(to: string, messageId: string, emoji: string): Promise; /** Mark a message as read */ markAsRead(messageId: string): Promise; } declare class InteractiveNamespace { private readonly adapter; constructor(adapter: WhatsAppProviderAdapter); /** Send a message with reply buttons (max 3) */ buttons(to: string, body: string, buttons: ButtonDef[], options?: InteractiveOptions): Promise; /** Send a list message with sections (max 10 sections) */ list(to: string, body: string, buttonText: string, sections: SectionDef[], options?: Omit & { header?: string; }): Promise; } declare class MediaNamespace { private readonly adapter; constructor(adapter: WhatsAppProviderAdapter); /** Upload media to the provider */ upload(params: MediaUpload): Promise; /** Get the download URL for a media item */ getUrl(mediaId: string): Promise; /** Download media as a ReadableStream — pipe directly to R2/S3 */ download(mediaIdOrUrl: string): Promise; /** Delete a previously uploaded media item */ delete(mediaId: string): Promise; } declare class WebhookNamespace { private readonly adapter; constructor(adapter: WhatsAppProviderAdapter); /** Parse a raw webhook payload into normalized events */ parse(body: unknown): WebhookEvent[]; /** Verify the cryptographic signature of a webhook payload */ verify(body: string, signature: string): Promise; /** * Handle the webhook verification challenge (GET request from Meta). * Returns the challenge string to respond with, or null if invalid. */ handleChallenge(query: Record): string | null; } declare class OtpNamespace { private readonly adapter; constructor(adapter: WhatsAppProviderAdapter); /** * Send a one-time password using an approved AUTHENTICATION template. * * Builds the correct auth-template payload — the code is placed in the body * and (by default) in the copy-code / one-tap autofill button — so callers * don't have to assemble template components by hand. * * @example * ```ts * await wa.otp.send('+966501234567', '123456', { template: 'login_code' }) * ``` */ send(to: string, code: string, options: OtpSendOptions): Promise; } declare class TemplateNamespace { private readonly adapter; constructor(adapter: WhatsAppProviderAdapter); /** List all message templates */ list(): Promise; /** Create a new message template */ create(input: CreateTemplateInput): Promise