UNPKG

ws-cloud-api

Version:

WhatsApp Cloud API for NodeJS

108 lines (105 loc) 3.14 kB
import { W as WsConfig } from './shared/ws-cloud-api.d6f9d022.cjs'; import { y as MessageResponse, W as WSBody, B as Button } from './shared/ws-cloud-api.f812c4fe.cjs'; import './shared/ws-cloud-api.fba8aa2f.cjs'; type SendMessageResponse = { success: false; error: unknown; } | { success: true; response: MessageResponse; }; declare function sendMessageRequest({ to, body, config }: { to: string; body: WSBody; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendText({ to, message, previewUrl, config }: { to: string; message: string; previewUrl?: boolean; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendImage({ to, link, config }: { to: string; link: string; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendVideo({ to, link, config }: { to: string; link: string; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendDocument({ to, link, filename, caption, config }: { to: string; link: string; filename: string; caption?: string; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendAudio({ to, link, config }: { to: string; link: string; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendFile({ to, file, config }: { to: string; file: Blob; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendButtonMessage({ to, message, config }: { to: string; message: { text: string; buttons: Button[]; }; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendCTAButtonMessage({ to, message, config }: { to: string; message: { text: string; buttonText: string; url: string; }; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendInteractiveListMessage({ to, list, config }: { to: string; list: { text: string; buttonText: string; list: Array<{ title: string; description: string; }>; }; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendInteractiveSectionListMessage({ to, list, config }: { to: string; list: { text: string; buttonText: string; sections: Array<{ sectionTitle: string; list: Array<{ title: string; description: string; }>; }>; }; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendFlowMessage({ to, flow, draft, config }: { to: string; flow: { id: string; text: string; token: string; ctaText: string; defaultScreen: string; }; draft?: boolean; config?: WsConfig; }): Promise<SendMessageResponse>; export { type SendMessageResponse, sendAudio, sendButtonMessage, sendCTAButtonMessage, sendDocument, sendFile, sendFlowMessage, sendImage, sendInteractiveListMessage, sendInteractiveSectionListMessage, sendMessageRequest, sendText, sendVideo };