import type { MachinatNode } from '@machinat/core'; import type { UnitSegment, PartSegment } from '@machinat/core/renderer'; import type { MessageValue, MessengerComponent } from '../types'; /** * At least one property must be set in addition to title. * @category Props */ export declare type GenericItemProps = { /** The title to display in the template. 80 character limit. */ title: string; /** The URL of the image to display in the template. */ imageUrl?: string; /** The subtitle to display in the template. 80 character limit. */ subtitle?: string; /** * Button elements to append to the template. A maximum of 3 buttons is * supported. */ buttons?: MachinatNode; /** * One {@link UrlButton} element to act as the default action executed when * the template is tapped. */ defaultAction?: MachinatNode; }; /** * The item of the {@link GenericTemplate}. * @category Component * @props {@link GenericItemProps} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic) * and [reference](https://developers.facebook.com/docs/messenger-platform/reference/templates/generic). */ export declare const GenericItem: MessengerComponent>; /** * @category Props */ export declare type GenericTemplateProps = { /** * {@link GenericItem} elements under the template. Specifying multiple * elements will send a horizontally scrollable carousel of templates. A * maximum of 10 elements is supported. */ children: MachinatNode; sharable?: boolean; /** * The aspect ratio used to render images specified by element.image_url. * Defaults to horizontal. */ imageAspectRatio?: 'horizontal' | 'square'; }; /** * The generic template allows you to send a structured message that includes an * image, text and buttons. A generic template with multiple templates described * in the elements array will send a horizontally scrollable carousel of items, * each composed of an image, text and buttons. * @category Component * @props {@link GenericTemplateProps} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic) * and [reference](https://developers.facebook.com/docs/messenger-platform/reference/templates/generic). */ export declare const GenericTemplate: MessengerComponent>; /** * @category Props */ export declare type ButtonTemplateProps = { /** * Textual node with content up to 640 characters. Text will appear above the * buttons. */ children: MachinatNode; /** 1-3 button elements to append after the text. */ buttons: MachinatNode; sharable?: boolean; }; /** * The button template allows you to send a structured message that includes * text and buttons. * @category Component * @props {@link ButtonTemplateProps} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button) * and [reference](https://developers.facebook.com/docs/messenger-platform/reference/templates/button). */ export declare const ButtonTemplate: MessengerComponent>; /** * @category Props */ export declare type MediaTemplateProps = { /** The type of media being sent */ mediaType: 'image' | 'video'; /** One optional button element to be appended to the template */ buttons?: MachinatNode; /** The attachment ID of the image or video. Cannot be used if url is set. */ attachmentId?: string; /** The URL of the image. Cannot be used if attachment_id is set. */ url?: string; /** * Set to true to enable the native share button in Messenger for the template * message. Defaults to false. */ sharable?: boolean; }; /** * The media template allows you to send a structured message that includes an * image or video, and an optional button. * @category Component * @props {@link MediaTemplate} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media) * and [reference](https://developers.facebook.com/docs/messenger-platform/reference/templates/media). */ export declare const MediaTemplate: MessengerComponent>; /** * @category Props */ export declare type ReceiptItemProps = { /** The name to display for the item. */ title: string; /** The subtitle for the item, usually a brief item description. */ subtitle?: string; /** The quantity of the item purchased. */ quantity?: number; /** The price of the item. For free items, '0' is allowed. */ price: number; /** The currency of the item price. */ currency?: string; /** The URL of an image to be displayed with the item. */ imageUrl?: string; }; /** * The item of {@link ReceiptTemplate} * @category Component * @props {@link ReceiptItemProps} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt) * and [reference](https://developers.facebook.com/docs/messenger-platform/reference/templates/receipt). */ export declare const ReceiptItem: MessengerComponent>; /** * @category Props */ export declare type ReceiptTemplateProps = { /** * Maximum of 100 {@line ReceiptItem} elements that describe items in the * order. Sort order of the elements is not guaranteed. */ children: MachinatNode; /** * Set to true to enable the native share button in Messenger for the * template message. Defaults to false. */ sharable?: boolean; /** The recipient's name. */ recipientName: string; /** The merchant's name. If present this is shown as logo text. */ merchantName?: string; /** The order number. Must be unique. */ orderNumber: string; /** The currency of the payment. */ currency: string; /** * The payment method used. Providing enough information for the customer to * decipher which payment method and account they used is recommended. This * can be a custom string, such as, "Visa 1234". */ paymentMethod: string; orderUrl?: string; /** Timestamp of the order in seconds. */ timestamp?: string | Date; /** The shipping address of the order. */ address?: string; summary: { /** Optional. The sub-total of the order. */ subtotal?: number; /** Optional. The shipping cost of the order. */ shipping_cost?: number; /** Optional. The tax of the order. */ total_tax?: number; /** The total cost of the order, including sub-total, shipping, and tax. */ total_cost: number; }; adjustments?: { /** Name of the adjustment. */ name: string; /** The amount of the adjustment. */ amount: number; }[]; }; /** * The receipt template allows you to send an order confirmation as a structured * message. * @category Component * @props {@link ReceiptTemplateProps} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt) * and [reference](https://developers.facebook.com/docs/messenger-platform/reference/templates/receipt). */ export declare const ReceiptTemplate: MessengerComponent>; /** * @category Props */ export declare type RequestOneTimeNotifProps = { /** The title to be displayed in the request message, limited to 65 characters. */ title: string; /** The data to be posted back with the `one_time_notif_optin` event. */ payload: string; }; /** * The Messenger Platform's One-Time Notification API (Beta) allows a page to * request a user to send one follow-up message after 24-hour messaging window * have ended. The user will be offered to receive a future notification. Once * the user asks to be notified, the page will receive a token which is an * equivalent to a permission to send a single message to the user. The token * can only be used once and will expire within 1 year of creation. * @category Component * @props {@link RequestOneTimeNotifProps} * @guides Check official [doc](https://developers.facebook.com/docs/messenger-platform/send-messages/one-time-notification). */ export declare const RequestOneTimeNotif: MessengerComponent>;