Function findComponentByType
- findComponentByType<T>(template: WhatsAppMessageTemplate, type: T): undefined | Extract<{
example?: Record<string, unknown>;
format?: WhatsAppTemplateHeaderFormat;
text?: string;
type: "HEADER";
}, {
type: T;
}> | Extract<{
example?: Record<string, unknown>;
text: string;
type: "BODY";
}, {
type: T;
}> | Extract<{
text: string;
type: "FOOTER";
}, {
type: T;
}> | Extract<{
buttons: WhatsAppTemplateButton[];
type: "BUTTONS";
}, {
type: T;
}>
-
Type Parameters
-
T extends "HEADER" | "BODY" | "FOOTER" | "BUTTONS"
Returns undefined | Extract<{
example?: Record<string, unknown>;
format?: WhatsAppTemplateHeaderFormat;
text?: string;
type: "HEADER";
}, {
type: T;
}> | Extract<{
example?: Record<string, unknown>;
text: string;
type: "BODY";
}, {
type: T;
}> | Extract<{
text: string;
type: "FOOTER";
}, {
type: T;
}> | Extract<{
buttons: WhatsAppTemplateButton[];
type: "BUTTONS";
}, {
type: T;
}>