import { OnRequestFunction } from 'messaging-api-common'; export declare type ClientConfig = { accessToken: string; channelSecret?: string; origin?: string; dataOrigin?: string; onRequest?: OnRequestFunction; }; /** * User Profile * */ export declare type User = { /** User's display name */ displayName: string; /** User ID */ userId: string; language?: string; /** Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image. */ pictureUrl: string; /** User's status message. Not included in the response if the user doesn't have a status message. */ statusMessage: string; }; /** * Group Summary */ export declare type Group = { /** Group ID */ groupId: string; /** Group Name */ groupName: string; /** Group icon URL */ pictureUrl: string; }; export declare type ImageMessage = { type: 'image'; /** * Image URL (Max character limit: 1000) * - HTTPS over TLS 1.2 or later * - JPEG * - Max: 4096 x 4096 * - Max: 1 MB */ originalContentUrl: string; /** * Preview image URL (Max character limit: 1000) * - HTTPS over TLS 1.2 or later * - JPEG * - Max: 240 x 240 * - Max: 1 MB */ previewImageUrl: string; }; /** * Defines the size of a tappable area. The top left is used as the origin of the area. Set these properties based on the `baseSize.width` property and the `baseSize.height` property. */ export declare type ImageMapArea = { /** Horizontal position relative to the left edge of the area. Value must be 0 or higher. */ x: number; /** Vertical position relative to the top of the area. Value must be 0 or higher. */ y: number; /** Width of the tappable area */ width: number; /** Height of the tappable area */ height: number; }; export declare type ImageMapUriAction = { type: 'uri'; /** * Label for the action. Spoken when the accessibility feature is enabled on the client device. * - Max character limit: 50 * - Supported on LINE 8.2.0 and later for iOS. */ label?: string; /** * - Webpage URL * - Max character limit: 1000 * * The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using the LINE URL scheme. */ linkUri: string; /** * Defined tappable area */ area: ImageMapArea; }; export declare type ImageMapMessageAction = { type: 'message'; /** * Label for the action. Spoken when the accessibility feature is enabled on the client device. * - Max character limit: 50 * - Supported on LINE 8.2.0 and later for iOS. */ label?: string; /** * Message to send * - Max character limit: 400 * - Supported on LINE for iOS and Android only. */ text: string; /** * Defined tappable area */ area: ImageMapArea; }; /** * Imagemap message * * Imagemap messages are messages configured with an image that has multiple tappable areas. You can assign one tappable area for the entire image or different tappable areas on divided areas of the image. * * You can also play a video on the image and display a label with a hyperlink after the video is finished. * * [Official document - imagemap message](https://developers.line.biz/en/reference/messaging-api/#imagemap-message) */ export declare type ImagemapMessage = { type: 'imagemap'; /** * Base URL of the image * - Max character limit: 1000 * - `HTTPS` over `TLS` 1.2 or later * - For more information about supported images in imagemap messages, see [How to configure an image](https://developers.line.biz/en/reference/messaging-api/#base-url). */ baseUrl: string; /** * Alternative text * - Max character limit: 400 */ altText: string; baseSize: { /** * Height of base image. Set to the height that corresponds to a width of 1040 pixels. */ height: number; /** * Width of base image in pixels. Set to 1040. */ width: number; }; video?: ImageMapVideo; /** * Imagemap action objects * * Object which specifies the actions and tappable areas of an imagemap. * * When an area is tapped, the user is redirected to the URI specified in `uri` and the message specified in `message` is sent. * * - Action when tapped * - Max: 50 */ actions: (ImageMapUriAction | ImageMapMessageAction)[]; }; export declare type VideoMessage = { type: 'video'; /** * URL of video file * - Max character limit: 1000 * - HTTPS over TLS 1.2 or later * - mp4 * - Max: 1 minute * - Max: 10 MB * * A very wide or tall video may be cropped when played in some environments. */ originalContentUrl: string; /** * URL of preview image * - Max character limit: 1000 * - HTTPS over TLS 1.2 or later * - JPEG * - Max: 240 x 240 * - Max: 1 MB */ previewImageUrl: string; }; export declare type AudioMessage = { type: 'audio'; /** * URL of audio file * - Max character limit: 1000 * - HTTPS over TLS 1.2 or later * - m4a * - Max: 1 minute * - Max: 10 MB */ originalContentUrl: string; /** * Length of audio file (milliseconds) */ duration: number; }; export declare type Location = { /** * Title * - Max character limit: 100 */ title: string; /** * Address * - Max character limit: 100 */ address: string; /** Latitude */ latitude: number; /** Longitude */ longitude: number; }; export declare type LocationMessage = { type: 'location'; /** * Title * - Max character limit: 100 */ title: string; /** * Address * - Max character limit: 100 */ address: string; /** Latitude */ latitude: number; /** Longitude */ longitude: number; }; export declare type StickerMessage = { type: 'sticker'; /** * Package ID for a set of stickers. For information on package IDs, see the [Sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf). */ packageId: string; /** * Sticker ID. For a list of sticker IDs for stickers that can be sent with the Messaging API, see the [Sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf). */ stickerId: string; }; /** * When a control associated with this action is tapped, a [postback event](https://developers.line.biz/en/reference/messaging-api/#postback-event) is returned via webhook with the specified string in the data property. */ export declare type PostbackAction = { type: 'postback'; /** * Label for the action * - Required for templates other than image carousel. Max character limit: 20 * - Optional for image carousel templates. Max character limit: 12 * - Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS. * - Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android. * - Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20 */ label?: string; /** * String returned via webhook in the postback.data property of the postback event * - Max character limit: 300 */ data: string; /** * 【Deprecated】 Text displayed in the chat as a message sent by the user when the action is performed. Returned from the server through a webhook. This property shouldn't be used with quick reply buttons. * - Max character limit: 300 * - The displayText and text properties cannot both be used at the same time. */ text?: string; /** * Text displayed in the chat as a message sent by the user when the action is performed. Required for quick reply buttons. Optional for the other message types. * - Max character limit: 300 * - The displayText and text properties cannot both be used at the same time. */ displayText?: string; }; /** * When a control associated with this action is tapped, the string in the `text` property is sent as a message from the user. */ export declare type MessageAction = { type: 'message'; /** * Label for the action * - Required for templates other than image carousel. Max character limit: 20 * - Optional for image carousel templates. Max character limit: 12 * - Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS. * - Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android. * - Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max charater limit: 20 */ label?: string; /** * Text sent when the action is performed * - Max character limit: 300 */ text: string; }; /** * When a control associated with this action is tapped, the URI specified in the `uri` property is opened. */ export declare type URIAction = { type: 'uri'; /** * Label for the action * - Required for templates other than image carousel. Max character limit: 20 * - Optional for image carousel templates. Max character limit: 12 * - Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS. * - Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20 */ label?: string; /** * URI opened when the action is performed (Max character limit: 1000) * * The available schemes are `http`, `https`, `line`, and `tel`. For more information about the LINE URL scheme, see Using the LINE URL scheme. */ uri: string; }; /** * When a control associated with this action is tapped, a [postback event](https://developers.line.biz/en/reference/messaging-api/#postback-event) is returned via webhook with the date and time selected by the user from the date and time selection dialog. The datetime picker action does not support time zones. */ export declare type DatetimePickerAction = { type: 'datetimepicker'; /** * Label for the action * - Required for templates other than image carousel. Max character limit: 20 * - Optional for image carousel templates. Max character limit: 12 * - Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS. * - Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android. * - Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20 */ label?: string; /** * String returned via webhook in the `postback.data` property of the [postback event](https://developers.line.biz/en/reference/messaging-api/#postback-event) * - Max character limit: 300 */ data: 'string'; /** * Action mode * - date: Pick date * - time: Pick time * - datetime: Pick date and time */ mode: 'date' | 'time' | 'datetime'; /** * Initial value of date or time. * * [Date and time format](https://developers.line.biz/en/reference/messaging-api/#date-and-time-format) */ initial?: string; /** * Largest date or time value that can be selected. Must be greater than the `min` value. * * [Date and time format](https://developers.line.biz/en/reference/messaging-api/#date-and-time-format) */ max?: string; /** * Smallest date or time value that can be selected. Must be less than the `max` value. * * [Date and time format](https://developers.line.biz/en/reference/messaging-api/#date-and-time-format) */ min?: string; }; /** * This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera screen in LINE is opened. */ export declare type CameraAction = { type: 'camera'; /** * Label for the action * - Max character limit: 20 */ label: string; }; /** * This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera roll screen in LINE is opened. */ export declare type CameraRollAction = { type: 'cameraRoll'; /** * Label for the action * - Max character limit: 20 */ label: string; }; /** * This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the location screen in LINE is opened. */ export declare type LocationAction = { type: 'location'; /** * Label for the action * - Max character limit: 20 */ label: string; }; export declare type Action = PostbackAction | MessageAction | URIAction | DatetimePickerAction | CameraAction | CameraRollAction | LocationAction; export declare type QuickReplyAction = PostbackAction | MessageAction | DatetimePickerAction | CameraAction | CameraRollAction | LocationAction; /** * This is a container that contains quick reply buttons. * * If a version of LINE that doesn't support the quick reply feature receives a message that contains quick reply buttons, only the message is displayed. */ export declare type QuickReply = { /** * This is a quick reply option that is displayed as a button. * * - Max: 13 objects */ items: { type: 'action'; /** * URL of the icon that is displayed at the beginning of the button * - Max character limit: 1000 * - URL scheme: https * - Image format: PNG * - Aspect ratio: 1:1 * - Data size: Up to 1 MB * * There is no limit on the image size. * * If the action property has a camera action, camera roll action, or location action, and the imageUrl property is not set, the default icon is displayed. */ imageUrl?: string; /** * Action performed when this button is tapped. Specify an action object. The following is a list of the available actions: * - Postback action * - Message action * - Datetime picker action * - Camera action * - Camera roll action * - Location action */ action: QuickReplyAction; }[]; }; /** * When sending a message from the LINE Official Account, you can specify the `sender.name` and the `sender.iconUrl` properties in Message objects. */ export declare type Sender = { /** * Display name. Certain words such as LINE may not be used. * * - Max character limit: 20 */ name?: string; /** * URL of the image to display as an icon when sending a message * * - Max character limit: 1000 * - URL scheme: https */ iconUrl?: string; }; /** * Common properties for messages * * The following properties can be specified in all the message objects. * - Quick reply * - sender */ export declare type MessageOptions = { /** * These properties are used for the quick reply feature. Supported on LINE 8.11.0 and later for iOS and Android. For more information, see [Using quick replies](https://developers.line.biz/en/docs/messaging-api/using-quick-reply/). */ quickReply?: QuickReply; sender?: Sender; }; /** * Template messages are messages with predefined layouts which you can customize. For more information, see Template messages. * * The following template types are available: * * - Buttons * - Confirm * - Carousel * - Image carousel */ export declare type TemplateMessage