evolution-api-sdk
Version:
Unofficial SDK for the Evolution Whatsapp API v2
44 lines (41 loc) • 950 B
TypeScript
import { ChatId, MessageId } from '../../../types/tags.js';
interface ComponentParameter {
type: "text" | "image" | "document" | "video";
text?: string;
image?: {
link: string;
};
document?: {
link: string;
};
video?: {
link: string;
};
}
interface Component {
type: "body" | "header" | "button";
sub_type?: "text" | "url" | "quick_reply";
parameters: ComponentParameter[];
}
interface TemplateMessageOptions {
number: ChatId;
name: string;
language: {
code: string;
};
components: Component[];
options?: {
delay?: number;
messageId?: MessageId;
};
}
interface TemplateMessageResponse {
key: {
remoteJid: ChatId;
fromMe: boolean;
id: MessageId;
};
messageTimestamp: string;
status: string;
}
export type { Component, ComponentParameter, TemplateMessageOptions, TemplateMessageResponse };