UNPKG

ws-cloud-api

Version:

WhatsApp Cloud API for NodeJS

120 lines (117 loc) 3.54 kB
import { W as WsConfig } from './shared/ws-cloud-api.d6f9d022.cjs'; import { Q as MessageResponse, W as WSBody, G as Contact, B as Button } from './shared/ws-cloud-api.7144280c.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 sendContact({ to, contacts, config }: { to: string; contacts: Contact[]; 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; initDataExchange?: boolean; }; draft?: boolean; config?: WsConfig; }): Promise<SendMessageResponse>; declare function sendTypingIndicator({ input, config }: { input: { messageId: string; }; config?: WsConfig; }): Promise<SendMessageResponse>; export { type SendMessageResponse, sendAudio, sendButtonMessage, sendCTAButtonMessage, sendContact, sendDocument, sendFile, sendFlowMessage, sendImage, sendInteractiveListMessage, sendInteractiveSectionListMessage, sendMessageRequest, sendText, sendTypingIndicator, sendVideo };