UNPKG

90.9 kBTypeScriptView Raw
1import { AxiosRequestConfig } from "axios";
2export interface Config {
3 channelAccessToken?: string;
4 channelSecret?: string;
5}
6export interface ClientConfig extends Config {
7 channelAccessToken: string;
8 httpConfig?: Partial<AxiosRequestConfig>;
9}
10export interface MiddlewareConfig extends Config {
11 channelSecret: string;
12}
13export declare type Profile = {
14 displayName: string;
15 userId: string;
16 pictureUrl: string;
17 statusMessage: string;
18 language?: string;
19};
20/**
21 * Request body which is sent by webhook.
22 *
23 * @see [Request body](https://developers.line.biz/en/reference/messaging-api/#request-body)
24 */
25export declare type WebhookRequestBody = {
26 /**
27 * User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, U[0-9a-f]{32}.
28 */
29 destination: string;
30 /**
31 * Information about the event
32 */
33 events: Array<WebhookEvent>;
34};
35/**
36 * JSON objects which contain events generated on the LINE Platform.
37 *
38 * @see [Webhook event objects](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects)
39 */
40export declare type WebhookEvent = MessageEvent | UnsendEvent | FollowEvent | UnfollowEvent | JoinEvent | LeaveEvent | MemberJoinEvent | MemberLeaveEvent | PostbackEvent | VideoPlayCompleteEvent | BeaconEvent | AccountLinkEvent | DeviceLinkEvent | DeviceUnlinkEvent | LINEThingsScenarioExecutionEvent;
41export declare type EventBase = {
42 /**
43 * Channel state.
44 *
45 * `active`: The channel is active. You can send a reply message or push message from the bot server that received this webhook event.
46 *
47 * `standby`: The channel is waiting. The bot server that received this webhook event shouldn't send any messages.
48 */
49 mode: "active" | "standby";
50 /**
51 * Time of the event in milliseconds
52 */
53 timestamp: number;
54 /**
55 * Source user, group, or room object with information about the source of the event.
56 */
57 source: EventSource;
58};
59export declare type EventSource = User | Group | Room;
60export declare type User = {
61 type: "user";
62 userId: string;
63};
64export declare type Group = {
65 type: "group";
66 groupId: string;
67 /**
68 * ID of the source user.
69 *
70 * Only included in [message events](https://developers.line.biz/en/reference/messaging-api/#message-event).
71 * Not included if the user has not agreed to the
72 * [Official Accounts Terms of Use](https://developers.line.biz/en/docs/messaging-api/user-consent/).
73 */
74 userId?: string;
75};
76export declare type Room = {
77 type: "room";
78 roomId: string;
79 /**
80 * ID of the source user.
81 *
82 * Only included in [message events](https://developers.line.biz/en/reference/messaging-api/#message-event).
83 * Not included if the user has not agreed to the
84 * [Official Accounts Terms of Use](https://developers.line.biz/en/docs/messaging-api/user-consent/).
85 */
86 userId?: string;
87};
88export declare type ReplyableEvent = EventBase & {
89 replyToken: string;
90};
91/**
92 * Webhook event object which contains the sent message.
93 *
94 * The `message` property contains a message object which corresponds with the
95 * message type. You can reply to message events.
96 *
97 * @see [Message event](https://developers.line.biz/en/reference/messaging-api/#message-event)
98 */
99export declare type MessageEvent = {
100 type: "message";
101 message: EventMessage;
102} & ReplyableEvent;
103/**
104 * Event object for when the user unsends a message in a [group](https://developers.line.biz/en/docs/messaging-api/group-chats/#group)
105 * or [room](https://developers.line.biz/en/docs/messaging-api/group-chats/#room).
106 * [Unsend event](https://developers.line.biz/en/reference/messaging-api/#unsend-event)
107 */
108export declare type UnsendEvent = {
109 type: "unsend";
110 /**
111 * The message ID of the unsent message
112 */
113 unsend: {
114 messageId: string;
115 };
116} & EventBase;
117/**
118 * Event object for when your account is added as a friend (or unblocked).
119 */
120export declare type FollowEvent = {
121 type: "follow";
122} & ReplyableEvent;
123/**
124 * Event object for when your account is blocked.
125 */
126export declare type UnfollowEvent = {
127 type: "unfollow";
128} & EventBase;
129/**
130 * Event object for when your bot joins a group or room. You can reply to join events.
131 *
132 * A join event is triggered at different times for groups and rooms.
133 *
134 * - For groups: A join event is sent when a user invites your bot.
135 * - For rooms: A join event is sent when the first event (for example when a
136 * user sends a message or is added to the room) occurs after your bot is
137 * added.
138 */
139export declare type JoinEvent = {
140 type: "join";
141} & ReplyableEvent;
142/**
143 * Event object for when a user removes your bot from a group or a room.
144 */
145export declare type LeaveEvent = {
146 type: "leave";
147} & EventBase;
148/**
149 * Event object for when a user joins a [group](https://developers.line.biz/en/docs/messaging-api/group-chats/#group)
150 * or [room](https://developers.line.biz/en/docs/messaging-api/group-chats/#room) that the bot is in.
151 */
152export declare type MemberJoinEvent = {
153 type: "memberJoined";
154 /**
155 * User ID of users who joined
156 * Array of [source user](https://developers.line.biz/en/reference/messaging-api/#source-user) objects
157 */
158 joined: {
159 members: Array<User>;
160 };
161} & ReplyableEvent;
162/**
163 * Event object for when a user leaves a [group](https://developers.line.biz/en/docs/messaging-api/group-chats/#group)
164 * or [room](https://developers.line.biz/en/docs/messaging-api/group-chats/#room) that the bot is in.
165 */
166export declare type MemberLeaveEvent = {
167 type: "memberLeft";
168 /**
169 * User ID of users who left
170 * Array of [source user](https://developers.line.biz/en/reference/messaging-api/#source-user) objects
171 */
172 left: {
173 members: Array<User>;
174 };
175} & EventBase;
176/**
177 * Event object for when a user performs an action on a
178 * [template message](https://developers.line.biz/en/reference/messaging-api/#template-messages).
179 */
180export declare type PostbackEvent = {
181 type: "postback";
182 postback: Postback;
183} & ReplyableEvent;
184/**
185 * Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account.
186 */
187export declare type VideoPlayCompleteEvent = {
188 type: "videoPlayComplete";
189 /**
190 * ID used to identify a video. Returns the same value as the trackingId assigned to the [video message](https://developers.line.biz/en/reference/messaging-api/#video-message).
191 * String
192 */
193 videoPlayComplete: {
194 trackingId: string;
195 };
196} & ReplyableEvent;
197/**
198 * Event object for when a user enters or leaves the range of a
199 * [LINE Beacon](https://developers.line.biz/en/docs/messaging-api/using-beacons/).
200 */
201export declare type BeaconEvent = ReplyableEvent & {
202 type: "beacon";
203 beacon: {
204 /**
205 * `leave` will be deprecated
206 */
207 type: "enter" | "leave" | "banner" | "stay";
208 /**
209 * Hardware ID of the beacon that was detected
210 */
211 hwid: string;
212 /**
213 * Device message of beacon that was detected.
214 *
215 * This message consists of data generated by the beacon to send notifications to bots.
216 * Only included in webhooks from devices that support the "device message" property.
217 * For more information, see the
218 * [LINE Simple Beacon specification](https://github.com/line/line-simple-beacon/blob/master/README.en.md/#line-simple-beacon-frame).
219 */
220 dm?: string;
221 };
222};
223/**
224 * Event object for when a user has linked his/her LINE account with a provider's service account.
225 */
226export declare type AccountLinkEvent = ReplyableEvent & {
227 type: "accountLink";
228 link: {
229 result: "ok" | "failed";
230 /**
231 * Specified nonce when verifying the user ID
232 */
233 nonce: string;
234 };
235};
236/**
237 * Indicates that a LINE Things-compatible device has been linked with LINE by a user operation.
238 * For more information, see [Receiving device link events via webhook](https://developers.line.biz/en/docs/line-things/develop-bot/#link-event).
239 */
240export declare type DeviceLinkEvent = ReplyableEvent & {
241 type: "things";
242 things: {
243 /**
244 * Device ID of the LINE Things-compatible device that was linked with LINE
245 */
246 deviceId: string;
247 type: "link";
248 };
249};
250/**
251 * Indicates that a LINE Things-compatible device has been unlinked from LINE by a user operation.
252 * For more information, see [Receiving device unlink events via webhook](https://developers.line.biz/en/docs/line-things/develop-bot/#unlink-event).
253 */
254export declare type DeviceUnlinkEvent = ReplyableEvent & {
255 type: "things";
256 things: {
257 /**
258 * Device ID of the LINE Things-compatible device that was unlinked with LINE
259 */
260 deviceId: string;
261 type: "unlink";
262 };
263};
264export declare type LINEThingsScenarioExecutionEvent = ReplyableEvent & {
265 type: "things";
266 things: {
267 type: "scenarioResult";
268 /**
269 * Device ID of the device that executed the scenario
270 */
271 deviceId: string;
272 result: {
273 /**
274 * Scenario ID executed
275 */
276 scenarioId: string;
277 /**
278 * Revision number of the scenario set containing the executed scenario
279 */
280 revision: number;
281 /**
282 * Timestamp for when execution of scenario action started (milliseconds, LINE app time)
283 */
284 startTime: number;
285 /**
286 * Timestamp for when execution of scenario was completed (milliseconds, LINE app time)
287 */
288 endtime: number;
289 /**
290 * Scenario execution completion status
291 * See also [things.resultCode definitions](https://developers.line.biz/en/reference/messaging-api/#things-resultcode).
292 */
293 resultCode: "success" | "gatt_error" | "runtime_error";
294 /**
295 * Execution result of individual operations specified in action
296 * Note that an array of actions specified in a scenario has the following characteristics
297 * - The actions defined in a scenario are performed sequentially, from top to bottom.
298 * - Each action produces some result when executed.
299 * Even actions that do not generate data, such as `SLEEP`, return an execution result of type `void`.
300 * The number of items in an action array may be 0.
301 *
302 * Therefore, things.actionResults has the following properties:
303 * - The number of items in the array matches the number of actions defined in the scenario.
304 * - The order of execution results matches the order in which actions are performed.
305 * That is, in a scenario set with multiple `GATT_READ` actions,
306 * the results are returned in the order in which each individual `GATT_READ` action was performed.
307 * - If 0 actions are defined in the scenario, the number of items in things.actionResults will be 0.
308 */
309 actionResults: Array<LINEThingsActionResult>;
310 /**
311 * Data contained in notification
312 * The value is Base64-encoded binary data.
313 * Only included for scenarios where `trigger.type = BLE_NOTIFICATION`.
314 */
315 bleNotificationPayload?: string;
316 /**
317 * Error reason
318 */
319 errorReason?: string;
320 };
321 };
322};
323export declare type LINEThingsActionResult = {
324 /**
325 * `void`, `binary`
326 * Depends on `type` of the executed action.
327 * This property is always included if `things.actionResults` is not empty.
328 */
329 type: "void" | "binary";
330 /**
331 * Base64-encoded binary data
332 * This property is always included when `things.actionResults[].type` is `binary`.
333 */
334 data?: string;
335};
336export declare type EventMessage = TextEventMessage | ImageEventMessage | VideoEventMessage | AudioEventMessage | LocationEventMessage | FileEventMessage | StickerEventMessage;
337export declare type EventMessageBase = {
338 id: string;
339};
340/**
341 * Message object which contains the text sent from the source.
342 */
343export declare type TextEventMessage = {
344 type: "text";
345 text: string;
346 /**
347 * Sendable LINE emojis
348 */
349 emojis?: {
350 index: number;
351 length: number;
352 productId: string;
353 emojiId: string;
354 }[];
355 /**
356 * Object containing the contents of the mentioned user.
357 */
358 mention?: {
359 /**
360 * Mentioned user information.
361 * Max: 20 mentions
362 */
363 mentionees: {
364 /**
365 * Index position of the user mention for a character in `text`,
366 * with the first character being at position 0.
367 */
368 index: number;
369 /**
370 * The length of the text of the mentioned user. For a mention `@example`,
371 * 8 is the length.
372 */
373 length: number;
374 userId: string;
375 }[];
376 };
377} & EventMessageBase;
378export declare type ContentProvider<WithPreview extends boolean = true> = {
379 /**
380 * The content is provided by LINE.
381 *
382 * The data itself can be retrieved from the content API.
383 */
384 type: "line";
385} | {
386 /**
387 * The content is provided by a provider other than LINE
388 */
389 type: "external";
390 /**
391 * URL of the content. Only included when contentProvider.type is external.
392 */
393 originalContentUrl: string;
394 /**
395 * URL of the content preview. Only included when contentProvider.type is external.
396 *
397 * For contents without preview (e.g. audio), it's undefined.
398 */
399 previewImageUrl: WithPreview extends true ? string : undefined;
400};
401/**
402 * Message object which contains the image content sent from the source.
403 * The binary image data can be retrieved using Client#getMessageContent.
404 */
405export declare type ImageEventMessage = {
406 type: "image";
407 contentProvider: ContentProvider;
408 /**
409 * Object containing the number of images sent simultaneously.
410 */
411 imageSet?: {
412 /**
413 * Image set ID. Only included when multiple images are sent simultaneously.
414 */
415 id: string;
416 /**
417 * An index starting from 1, indicating the image number in a set of images sent simultaneously.
418 * Only included when multiple images are sent simultaneously.
419 * However, it won't be included if the sender is using LINE 11.15 or earlier for Android.
420 */
421 index: number;
422 /**
423 * The total number of images sent simultaneously.
424 * If two images are sent simultaneously, the number is 2.
425 * Only included when multiple images are sent simultaneously.
426 * However, it won't be included if the sender is using LINE 11.15 or earlier for Android.
427 */
428 total: number;
429 };
430} & EventMessageBase;
431/**
432 * Message object which contains the video content sent from the source.
433 * The binary video data can be retrieved using Client#getMessageContent.
434 */
435export declare type VideoEventMessage = {
436 type: "video";
437 contentProvider: ContentProvider;
438} & EventMessageBase;
439/**
440 * Message object which contains the audio content sent from the source.
441 * The binary audio data can be retrieved using Client#getMessageContent.
442 */
443export declare type AudioEventMessage = {
444 type: "audio";
445 duration: number;
446 contentProvider: ContentProvider<false>;
447} & EventMessageBase;
448/**
449 * Message object which contains the file sent from the source.
450 * The binary data can be retrieved using Client#getMessageContent.
451 */
452export declare type FileEventMessage = {
453 type: "file";
454 fileName: string;
455 fileSize: string;
456} & EventMessageBase;
457/**
458 * Message object which contains the location data sent from the source.
459 */
460export declare type LocationEventMessage = {
461 type: "location";
462 title: string;
463 address: string;
464 latitude: number;
465 longitude: number;
466} & EventMessageBase;
467/**
468 * Message object which contains the sticker data sent from the source.
469 * For a list of basic LINE stickers and sticker IDs, see
470 * [sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
471 */
472export declare type StickerEventMessage = {
473 type: "sticker";
474 packageId: string;
475 stickerId: string;
476 stickerResourceType: "STATIC" | "ANIMATION" | "SOUND" | "ANIMATION_SOUND" | "POPUP" | "POPUP_SOUND" | "CUSTOM" | "MESSAGE";
477 keywords: string[];
478 /**
479 * Any text entered by the user. This property is only included for message stickers.
480 * Max character limit: 100
481 */
482 text?: string;
483} & EventMessageBase;
484export declare type Postback = {
485 data: string;
486 params?: DateTimePostback | RichMenuSwitchPostback;
487};
488/**
489 * Object with the date and time selected by a user through a
490 * [datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action).
491 * Only returned for postback actions via a
492 * [datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action).
493 * The `full-date`, `time-hour`, and `time-minute` formats follow the
494 * [RFC3339 protocol](https://www.ietf.org/rfc/rfc3339.txt).
495 */
496declare type DateTimePostback = {
497 /**
498 * Date selected by user. Only included in the `date` mode.
499 */
500 date?: string;
501 /**
502 * Time selected by the user. Only included in the `time` mode.
503 */
504 time?: string;
505 /**
506 * Date and time selected by the user. Only included in the `datetime` mode.
507 */
508 datetime?: string;
509};
510/**
511 * Object with rich menu alias ID selected by user via rich menu switch action.
512 * https://developers.line.biz/en/reference/messaging-api/#postback-params-object-for-richmenu-switch-action
513 */
514declare type RichMenuSwitchPostback = {
515 newRichMenuAliasId: string;
516 status: "SUCCESS" | "RICHMENU_ALIAS_ID_NOTFOUND" | "RICHMENU_NOTFOUND" | "FAILED";
517};
518/**
519 * JSON object which contains the contents of the message you send.
520 *
521 * @see [Message objects](https://developers.line.biz/en/reference/messaging-api/#message-objects)
522 */
523export declare type Message = TextMessage | ImageMessage | VideoMessage | AudioMessage | LocationMessage | StickerMessage | ImageMapMessage | TemplateMessage | FlexMessage;
524/**
525 * @see [Common properties for messages](https://developers.line.biz/en/reference/messaging-api/#common-properties-for-messages)
526 */
527export declare type MessageCommon = {
528 /**
529 * For the quick reply feature.
530 * For more information, see [Using quick replies](https://developers.line.biz/en/docs/messaging-api/using-quick-reply/).
531 *
532 * If the user receives multiple
533 * [message objects](https://developers.line.biz/en/reference/messaging-api/#message-objects),
534 * the quickReply property of the last message object is displayed.
535 */
536 quickReply?: QuickReply;
537 /**
538 * [Change icon and display name](https://developers.line.biz/en/docs/messaging-api/icon-nickname-switch/)
539 *
540 * When sending a message from the LINE Official Account, you can specify the `sender.name` and the `sender.iconUrl` properties in [Message objects](https://developers.line.biz/en/reference/messaging-api/#message-objects).
541 */
542 sender?: Sender;
543};
544/**
545 * @see [Text message](https://developers.line.biz/en/reference/messaging-api/#text-message)
546 */
547export declare type TextMessage = MessageCommon & {
548 type: "text";
549 /**
550 * Message text. You can include the following emoji:
551 *
552 * - LINE emojis. Use a $ character as a placeholder and specify the product ID and emoji ID of the LINE emoji you want to use in the emojis property.
553 * - Unicode emoji
554 * - (Deprecated) LINE original unicode emojis
555 * ([Unicode codepoint table for LINE original emoji](https://developers.line.biz/media/messaging-api/emoji-list.pdf))
556 *
557 * Max: 5000 characters
558 */
559 text: string;
560 /**
561 * One or more LINE emoji.
562 *
563 * Max: 20 LINE emoji
564 */
565 emojis?: {
566 index: number;
567 productId: string;
568 emojiId: string;
569 }[];
570};
571/**
572 * @see [Image message](https://developers.line.biz/en/reference/messaging-api/#image-message)
573 */
574export declare type ImageMessage = MessageCommon & {
575 type: "image";
576 /**
577 * Image URL (Max: 2000 characters)
578 *
579 * - **HTTPS**
580 * - JPEG
581 * - Max: 1024 x 1024
582 * - Max: 1 MB
583 */
584 originalContentUrl: string;
585 /**
586 * Preview image URL (Max: 2000 characters)
587 *
588 * - **HTTPS**
589 * - JPEG
590 * - Max: 240 x 240
591 * - Max: 1 MB
592 */
593 previewImageUrl: string;
594};
595/**
596 * @see [Video message](https://developers.line.biz/en/reference/messaging-api/#video-message)
597 */
598export declare type VideoMessage = MessageCommon & {
599 type: "video";
600 /**
601 * URL of video file (Max: 2000 characters)
602 *
603 * - **HTTPS**
604 * - mp4
605 * - Max: 1 minute
606 * - Max: 10 MB
607 *
608 * A very wide or tall video may be cropped when played in some environments.
609 */
610 originalContentUrl: string;
611 /**
612 * URL of preview image (Max: 2000 characters)
613 *
614 * - **HTTPS**
615 * - JPEG
616 * - Max: 240 x 240
617 * - Max: 1 MB
618 */
619 previewImageUrl: string;
620};
621/**
622 * @see [Audio message](https://developers.line.biz/en/reference/messaging-api/#audio-message)
623 */
624export declare type AudioMessage = MessageCommon & {
625 type: "audio";
626 /**
627 * URL of audio file (Max: 2000 characters)
628 *
629 * - **HTTPS**
630 * - m4a
631 * - Max: 1 minute
632 * - Max: 10 MB
633 */
634 originalContentUrl: string;
635 /**
636 * Length of audio file (milliseconds)
637 */
638 duration: number;
639};
640/**
641 * @see [Location message](https://developers.line.biz/en/reference/messaging-api/#location-message)
642 */
643export declare type LocationMessage = MessageCommon & {
644 type: "location";
645 /**
646 * Title (Max: 100 characters)
647 */
648 title: string;
649 /**
650 * Address (Max: 100 characters)
651 */
652 address: string;
653 latitude: number;
654 longitude: number;
655};
656/**
657 * @see [Sticker message](https://developers.line.biz/en/reference/messaging-api/#sticker-message)
658 */
659export declare type StickerMessage = MessageCommon & {
660 type: "sticker";
661 /**
662 * Package ID for a set of stickers.
663 * For information on package IDs, see the
664 * [Sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
665 */
666 packageId: string;
667 /**
668 * Sticker ID.
669 * For a list of sticker IDs for stickers that can be sent with the Messaging
670 * API, see the
671 * [Sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
672 */
673 stickerId: string;
674};
675/**
676 * @see [Imagemap message](https://developers.line.biz/en/reference/messaging-api/#imagemap-message)
677 */
678export declare type ImageMapMessage = MessageCommon & {
679 type: "imagemap";
680 /**
681 * [Base URL](https://developers.line.biz/en/reference/messaging-api/#base-url) of image
682 * (Max: 2000 characters, **HTTPS**)
683 */
684 baseUrl: string;
685 /**
686 * Alternative text (Max: 400 characters)
687 */
688 altText: string;
689 baseSize: Size;
690 /**
691 * Video to play inside a image map messages
692 */
693 video?: {
694 /**
695 * URL of video file (Max: 2000 characters)
696 *
697 * - **HTTPS**
698 * - mp4
699 * - Max: 1 minute
700 * - Max: 10 MB
701 *
702 * A very wide or tall video may be cropped when played in some environments.
703 */
704 originalContentUrl: string;
705 /**
706 * URL of preview image (Max: 2000 characters)
707 *
708 * - **HTTPS**
709 * - JPEG
710 * - Max: 240 x 240
711 * - Max: 1 MB
712 */
713 previewImageUrl: string;
714 area: Area;
715 /**
716 * External link to be displayed after a video is played
717 * This property is required if you set a video to play and a label to display after the video on the imagemap
718 */
719 externalLink?: {
720 linkUri: string;
721 label: string;
722 };
723 };
724 /**
725 * Action when tapped (Max: 50)
726 */
727 actions: ImageMapAction[];
728};
729/**
730 * Template messages are messages with predefined layouts which you can
731 * customize. For more information, see
732 * [template messages](https://developers.line.biz/en/docs/messaging-api/message-types/#template-messages).
733 *
734 * The following template types are available:
735 *
736 * - [Buttons](https://developers.line.biz/en/reference/messaging-api/#buttons)
737 * - [Confirm](https://developers.line.biz/en/reference/messaging-api/#confirm)
738 * - [Carousel](https://developers.line.biz/en/reference/messaging-api/#carousel)
739 * - [Image carousel](https://developers.line.biz/en/reference/messaging-api/#image-carousel)
740 *
741 * @see [Template messages](https://developers.line.biz/en/reference/messaging-api/#template-messages)
742 */
743export declare type TemplateMessage = MessageCommon & {
744 type: "template";
745 /**
746 * Alternative text (Max: 400 characters)
747 */
748 altText: string;
749 /**
750 * Carousel template content
751 */
752 template: TemplateContent;
753};
754/**
755 * Flex Messages are messages with a customizable layout.
756 * You can customize the layout freely by combining multiple elements.
757 * For more information, see
758 * [Using Flex Messages](https://developers.line.biz/en/docs/messaging-api/using-flex-messages/).
759 *
760 * @see [Flex messages](https://developers.line.biz/en/reference/messaging-api/#flex-message)
761 */
762export declare type FlexMessage = MessageCommon & {
763 type: "flex";
764 altText: string;
765 contents: FlexContainer;
766};
767/**
768 * Object which specifies the actions and tappable regions of an imagemap.
769 *
770 * When a region is tapped, the user is redirected to the URI specified in
771 * `uri` and the message specified in `message` is sent.
772 *
773 * @see [Imagemap action objects](https://developers.line.biz/en/reference/messaging-api/#imagemap-action-objects)
774 */
775export declare type ImageMapAction = ImageMapURIAction | ImageMapMessageAction;
776export declare type ImageMapActionBase = {
777 /**
778 * Spoken when the accessibility feature is enabled on the client device. (Max: 50 characters)
779 * Supported on LINE 8.2.0 and later for iOS.
780 */
781 label?: string;
782 /** Defined tappable area */
783 area: Area;
784};
785export declare type ImageMapURIAction = {
786 type: "uri";
787 /**
788 * Webpage URL (Max: 1000 characters)
789 */
790 linkUri: string;
791} & ImageMapActionBase;
792export declare type ImageMapMessageAction = {
793 type: "message";
794 /**
795 * Message to send (Max: 400 characters)
796 */
797 text: string;
798} & ImageMapActionBase;
799export declare type Area = {
800 /**
801 * Horizontal position relative to the top-left corner of the area
802 */
803 x: number;
804 /**
805 * Vertical position relative to the top-left corner of the area
806 */
807 y: number;
808 /**
809 * Width of the tappable area
810 */
811 width: number;
812 /**
813 * Height of the tappable area
814 */
815 height: number;
816};
817/**
818 * A container is the top-level structure of a Flex Message. Here are the types of containers available.
819 *
820 * - [Bubble](https://developers.line.biz/en/reference/messaging-api/#bubble)
821 * - [Carousel](https://developers.line.biz/en/reference/messaging-api/#f-carousel)
822 *
823 * See [Flex Message elements](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/)
824 * for the containers' JSON data samples and usage.
825 */
826export declare type FlexContainer = FlexBubble | FlexCarousel;
827/**
828 * This is a container that contains one message bubble. It can contain four
829 * blocks: header, hero, body, and footer.
830 *
831 * For more information about using each block, see
832 * [Block](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/#block).
833 */
834export declare type FlexBubble = {
835 type: "bubble";
836 size?: "nano" | "micro" | "kilo" | "mega" | "giga";
837 /**
838 * Text directionality and the order of components in horizontal boxes in the
839 * container. Specify one of the following values:
840 *
841 * - `ltr`: Left to right
842 * - `rtl`: Right to left
843 *
844 * The default value is `ltr`.
845 */
846 direction?: "ltr" | "rtl";
847 header?: FlexBox;
848 hero?: FlexBox | FlexImage | FlexVideo;
849 body?: FlexBox;
850 footer?: FlexBox;
851 styles?: FlexBubbleStyle;
852 action?: Action;
853};
854export declare type FlexBubbleStyle = {
855 header?: FlexBlockStyle;
856 hero?: FlexBlockStyle;
857 body?: FlexBlockStyle;
858 footer?: FlexBlockStyle;
859};
860export declare type FlexBlockStyle = {
861 /**
862 * Background color of the block. Use a hexadecimal color code.
863 */
864 backgroundColor?: string;
865 /**
866 * - `true` to place a separator above the block.
867 * - `true` will be ignored for the first block in a container because you
868 * cannot place a separator above the first block.
869 * - The default value is `false`.
870 */
871 separator?: boolean;
872 /**
873 * Color of the separator. Use a hexadecimal color code.
874 */
875 separatorColor?: string;
876};
877export declare type FlexCarousel = {
878 type: "carousel";
879 /**
880 * (Max: 12 bubbles)
881 */
882 contents: FlexBubble[];
883};
884/**
885 * Components are objects that compose a Flex Message container. Here are the
886 * types of components available:
887 *
888 * - [Box](https://developers.line.biz/en/reference/messaging-api/#box)
889 * - [Button](https://developers.line.biz/en/reference/messaging-api/#button)
890 * - [Image](https://developers.line.biz/en/reference/messaging-api/#f-image)
891 * - [Video](https://developers.line.biz/en/reference/messaging-api/#f-video)
892 * - [Icon](https://developers.line.biz/en/reference/messaging-api/#icon)
893 * - [Text](https://developers.line.biz/en/reference/messaging-api/#f-text)
894 * - [Span](https://developers.line.biz/en/reference/messaging-api/#span)
895 * - [Separator](https://developers.line.biz/en/reference/messaging-api/#separator)
896 * - [Filler](https://developers.line.biz/en/reference/messaging-api/#filler)
897 * - [Spacer (not recommended)](https://developers.line.biz/en/reference/messaging-api/#spacer)
898 *
899 * See the followings for the components' JSON data samples and usage.
900 *
901 * - [Flex Message elements](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/)
902 * - [Flex Message layout](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/)
903 */
904export declare type FlexComponent = FlexBox | FlexButton | FlexImage | FlexVideo | FlexIcon | FlexText | FlexSpan | FlexSeparator | FlexFiller | FlexSpacer;
905/**
906 * This is a component that defines the layout of child components.
907 * You can also include a box in a box.
908 */
909export declare type FlexBox = {
910 type: "box";
911 /**
912 * The placement style of components in this box. Specify one of the following values:
913 *
914 * - `horizontal`: Components are placed horizontally. The `direction`
915 * property of the [bubble](https://developers.line.biz/en/reference/messaging-api/#bubble)
916 * container specifies the order.
917 * - `vertical`: Components are placed vertically from top to bottom.
918 * - `baseline`: Components are placed in the same way as `horizontal` is
919 * specified except the baselines of the components are aligned.
920 *
921 * For more information, see
922 * [Types of box layouts](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#box-layout-types).
923 */
924 layout: "horizontal" | "vertical" | "baseline";
925 /**
926 * Components in this box. Here are the types of components available:
927 *
928 * - When the `layout` property is `horizontal` or `vertical`:
929 * + [Box](https://developers.line.biz/en/reference/messaging-api/#box)
930 * + [button](https://developers.line.biz/en/reference/messaging-api/#button)
931 * + [image](https://developers.line.biz/en/reference/messaging-api/#f-image)
932 * + [text](https://developers.line.biz/en/reference/messaging-api/#f-text)
933 * + [separator](https://developers.line.biz/en/reference/messaging-api/#separator)
934 * + [filler](https://developers.line.biz/en/reference/messaging-api/#filler)
935 * + [spacer (not recommended)](https://developers.line.biz/en/reference/messaging-api/#spacer)
936 * - When the `layout` property is `baseline`:
937 * + [icon](https://developers.line.biz/en/reference/messaging-api/#icon)
938 * + [text](https://developers.line.biz/en/reference/messaging-api/#f-text)
939 * + [filler](https://developers.line.biz/en/reference/messaging-api/#filler)
940 * + [spacer (not recommended)](https://developers.line.biz/en/reference/messaging-api/#spacer)
941 */
942 contents: FlexComponent[];
943 /**
944 * Background color of the block. In addition to the RGB color, an alpha
945 * channel (transparency) can also be set. Use a hexadecimal color code.
946 * (Example:#RRGGBBAA) The default value is `#00000000`.
947 */
948 backgroundColor?: string;
949 /**
950 * Color of box border. Use a hexadecimal color code.
951 */
952 borderColor?: string;
953 /**
954 * Width of box border. You can specify a value in pixels or any one of none,
955 * light, normal, medium, semi-bold, or bold. none does not render a border
956 * while the others become wider in the order of listing.
957 */
958 borderWidth?: string | "none" | "light" | "normal" | "medium" | "semi-bold" | "bold";
959 /**
960 * Radius at the time of rounding the corners of the border. You can specify a
961 * value in pixels or any one of `none`, `xs`, `sm`, `md`, `lg`, `xl`, or `xxl`. none does not
962 * round the corner while the others increase in radius in the order of listing. The default value is none.
963 */
964 cornerRadius?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
965 /**
966 * Width of the box. For more information, see [Width of a box](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#box-width) in the API documentation.
967 */
968 width?: string;
969 /**
970 * Max width of the box. For more information, see [Max width of a box](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#box-max-width) in the API documentation.
971 */
972 maxWidth?: string;
973 /**
974 * Height of the box. For more information, see [Height of a box](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#box-height) in the API documentation.
975 */
976 height?: string;
977 /**
978 * Max height of the box. For more information, see [Max height of a box](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#box-max-height) in the API documentation.
979 */
980 maxHeight?: string;
981 /**
982 * The ratio of the width or height of this box within the parent box. The
983 * default value for the horizontal parent box is `1`, and the default value
984 * for the vertical parent box is `0`.
985 *
986 * For more information, see
987 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
988 */
989 flex?: number;
990 /**
991 * Minimum space between components in this box.
992 *
993 * - `none` does not set a space while the other values set a space whose
994 * size increases in the order of listing.
995 * - The default value is `none`.
996 * - To override this setting for a specific component, set the `margin`
997 * property of that component.
998 */
999 spacing?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1000 /**
1001 * Minimum space between this box and the previous component in the parent box.
1002 *
1003 * - `none` does not set a space while the other values set a space whose
1004 * size increases in the order of listing.
1005 * - The default value is the value of the `spacing` property of the parent
1006 * box.
1007 * - If this box is the first component in the parent box, the `margin`
1008 * property will be ignored.
1009 */
1010 margin?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1011 /**
1012 * Free space between the borders of this box and the child element.
1013 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
1014 */
1015 paddingAll?: string;
1016 /**
1017 * Free space between the border at the upper end of this box and the upper end of the child element.
1018 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
1019 */
1020 paddingTop?: string;
1021 /**
1022 * Free space between the border at the lower end of this box and the lower end of the child element.
1023 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
1024 */
1025 paddingBottom?: string;
1026 /**
1027 * Free space between the border at the left end of this box and the left end of the child element.
1028 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
1029 */
1030 paddingStart?: string;
1031 /**
1032 * Free space between the border at the right end of this box and the right end of the child element.
1033 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
1034 */
1035 paddingEnd?: string;
1036 /**
1037 * Action performed when this button is tapped.
1038 *
1039 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1040 */
1041 action?: Action;
1042 /**
1043 * How child elements are aligned along the main axis of the parent element. If the
1044 * parent element is a horizontal box, this only takes effect when its child elements have
1045 * their `flex` property set equal to 0. For more information, see [Arranging a box's child elements and free space](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#justify-property)
1046 * in the Messaging API documentation.
1047 */
1048 justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
1049 /**
1050 * How child elements are aligned along the cross axis of the parent element. For more
1051 * information, see [Arranging a box's child elements and free space](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#justify-property) in the Messaging API documentation.
1052 */
1053 alignItems?: "flex-start" | "center" | "flex-end";
1054 background?: Background;
1055} & Offset;
1056export declare type Offset = {
1057 /**
1058 * Reference position for placing this box. Specify one of the following values:
1059 * - `relative`: Use the previous box as reference.
1060 * - `absolute`: Use the top left of parent element as reference.
1061 *
1062 * The default value is relative.
1063 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1064 */
1065 position?: "relative" | "absolute";
1066 /**
1067 * The top offset.
1068 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1069 */
1070 offsetTop?: string;
1071 /**
1072 * The bottom offset.
1073 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1074 */
1075 offsetBottom?: string;
1076 /**
1077 * The left offset.
1078 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1079 */
1080 offsetStart?: string;
1081 /**
1082 * The right offset.
1083 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1084 */
1085 offsetEnd?: string;
1086};
1087export declare type Background = {
1088 /**
1089 * The type of background used. Specify these values:
1090 * - `linearGradient`: Linear gradient. For more information, see [Linear gradient backgrounds](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#linear-gradient-bg) in the Messaging API documentation.
1091 */
1092 type: "linearGradient";
1093 /**
1094 * The angle at which a linear gradient moves. Specify the angle using an integer value
1095 * like `90deg` (90 degrees) or a decimal number like `23.5deg` (23.5 degrees) in the
1096 * half-open interval [0, 360). The direction of the linear gradient rotates clockwise as the
1097 * angle increases. Given a value of `0deg`, the gradient starts at the bottom and ends at
1098 * the top; given a value of `45deg`, the gradient starts at the bottom-left corner and ends
1099 * at the top-right corner; given a value of 90deg, the gradient starts at the left and ends
1100 * at the right; and given a value of `180deg`, the gradient starts at the top and ends at
1101 * the bottom. For more information, see [Direction (angle) of linear gradient backgrounds](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#linear-gradient-bg-angle) in the Messaging API documentation.
1102 */
1103 angle: string;
1104 /**
1105 * The color at the gradient's starting point. Use a hexadecimal color code in the
1106 * `#RRGGBB` or `#RRGGBBAA` format.
1107 */
1108 startColor: string;
1109 /**
1110 * The color at the gradient's ending point. Use a hexadecimal color code in the
1111 * `#RRGGBB` or `#RRGGBBAA` format.
1112 */
1113 endColor: string;
1114 /**
1115 * The color in the middle of the gradient. Use a hexadecimal color code in the `#RRGGBB`
1116 * or `#RRGGBBAA` format. Specify a value for the `background.centerColor` property to
1117 * create a gradient that has three colors. For more information, see [Intermediate color stops for linear gradients](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#linear-gradient-bg-center-color) in the
1118 * Messaging API documentation.
1119 */
1120 centerColor?: string;
1121 /**
1122 * The position of the intermediate color stop. Specify an integer or decimal value
1123 * between `0%` (the starting point) and `100%` (the ending point). This is `50%` by
1124 * default. For more information, see [Intermediate color stops for linear gradients](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#linear-gradient-bg-center-color) in the
1125 * Messaging API documentation.
1126 */
1127 centerPosition?: string;
1128};
1129/**
1130 * This component draws a button.
1131 *
1132 * When the user taps a button, a specified action is performed.
1133 */
1134export declare type FlexButton = {
1135 type: "button";
1136 /**
1137 * Action performed when this button is tapped.
1138 *
1139 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1140 */
1141 action: Action;
1142 /**
1143 * The ratio of the width or height of this box within the parent box.
1144 *
1145 * The default value for the horizontal parent box is `1`, and the default
1146 * value for the vertical parent box is `0`.
1147 *
1148 * For more information, see
1149 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1150 */
1151 flex?: number;
1152 /**
1153 * Minimum space between this box and the previous component in the parent box.
1154 *
1155 * - `none` does not set a space while the other values set a space whose
1156 * size increases in the order of listing.
1157 * - The default value is the value of the `spacing` property of the parent
1158 * box.
1159 * - If this box is the first component in the parent box, the `margin`
1160 * property will be ignored.
1161 */
1162 margin?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1163 /**
1164 * Height of the button. The default value is `md`.
1165 */
1166 height?: "sm" | "md";
1167 /**
1168 * Style of the button. Specify one of the following values:
1169 *
1170 * - `link`: HTML link style
1171 * - `primary`: Style for dark color buttons
1172 * - `secondary`: Style for light color buttons
1173 *
1174 * The default value is `link`.
1175 */
1176 style?: "link" | "primary" | "secondary";
1177 /**
1178 * Use a hexadecimal color code.
1179 *
1180 * - Character color when the `style` property is `link`.
1181 * - Background color when the `style` property is `primary` or `secondary`.
1182 */
1183 color?: string;
1184 /**
1185 * Vertical alignment style. Specify one of the following values:
1186 *
1187 * - `top`: Top-aligned
1188 * - `bottom`: Bottom-aligned
1189 * - `center`: Center-aligned
1190 *
1191 * The default value is `top`.
1192 *
1193 * If the `layout` property of the parent box is `baseline`, the `gravity`
1194 * property will be ignored.
1195 */
1196 gravity?: "top" | "bottom" | "center";
1197 /**
1198 * The method by which to adjust the text font size. Specify this value:
1199 *
1200 * - `shrink-to-fit`: Automatically shrink the font
1201 * size to fit the width of the component. This
1202 * property takes a "best-effort" approach that may
1203 * work differently—or not at all!—on some platforms.
1204 * For more information, see [Automatically shrink fonts to fit](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#adjusts-fontsize-to-fit)
1205 * in the Messaging API documentation.
1206 * - LINE 10.13.0 or later for iOS and Android
1207 */
1208 adjustMode?: "shrink-to-fit";
1209} & Offset;
1210/**
1211 * This is an invisible component to fill extra space between components.
1212 *
1213 * - The filler's `flex` property is fixed to 1.
1214 * - The `spacing` property of the parent box will be ignored for fillers.
1215 */
1216export declare type FlexFiller = {
1217 type: "filler";
1218 /**
1219 * The ratio of the width or height of this component within the parent box. For more information, see [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1220 */
1221 flex?: number;
1222};
1223/**
1224 * This component draws an icon.
1225 */
1226export declare type FlexIcon = {
1227 type: "icon";
1228 /**
1229 * Image URL (Max character limit: 2000)
1230 *
1231 * Protocol: HTTPS
1232 * Image format: JPEG or PNG
1233 * Maximum image size: 240×240 pixels
1234 * Maximum data size: 1 MB
1235 */
1236 url: string;
1237 /**
1238 * Minimum space between this box and the previous component in the parent
1239 * box.
1240 *
1241 * - `none` does not set a space while the other values set a space whose
1242 * size increases in the order of listing.
1243 * - The default value is the value of the `spacing` property of the parent
1244 * box.
1245 * - If this box is the first component in the parent box, the `margin`
1246 * property will be ignored.
1247 */
1248 margin?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1249 /**
1250 * Maximum size of the icon width.
1251 * The size increases in the order of listing.
1252 * The default value is `md`.
1253 * For more information, see [Icon, text, and span size](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#other-component-size) in the Messaging API documentation.
1254 */
1255 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl";
1256 /**
1257 * Aspect ratio of the icon. `{width}:{height}` format.
1258 * The values of `{width}` and `{height}` must be in the range 1–100000.
1259 * `{height}` can't be more than three times the value of `{width}`.
1260 * The default value is `1:1`.
1261 */
1262 aspectRatio?: string;
1263} & Offset;
1264/**
1265 * This component draws an image.
1266 */
1267export declare type FlexImage = {
1268 type: "image";
1269 /**
1270 * Image URL (Max character limit: 2000)
1271 *
1272 * - Protocol: HTTPS
1273 * - Image format: JPEG or PNG
1274 * - Maximum image size: 1024×1024 pixels
1275 * - Maximum data size: 1 MB
1276 */
1277 url: string;
1278 /**
1279 * The ratio of the width or height of this box within the parent box.
1280 *
1281 * The default value for the horizontal parent box is `1`, and the default
1282 * value for the vertical parent box is `0`.
1283 *
1284 * - For more information, see
1285 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1286 */
1287 flex?: number;
1288 /**
1289 * Minimum space between this box and the previous component in the parent
1290 * box.
1291 *
1292 * - `none` does not set a space while the other values set a space whose
1293 * size increases in the order of listing.
1294 * - The default value is the value of the `spacing` property of the parent
1295 * box.
1296 * - If this box is the first component in the parent box, the `margin`
1297 * property will be ignored.
1298 */
1299 margin?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1300 /**
1301 * Horizontal alignment style. Specify one of the following values:
1302 *
1303 * - `start`: Left-aligned
1304 * - `end`: Right-aligned
1305 * - `center`: Center-aligned
1306 *
1307 * The default value is `center`.
1308 */
1309 align?: "start" | "end" | "center";
1310 /**
1311 * Vertical alignment style. Specify one of the following values:
1312 *
1313 * - `top`: Top-aligned
1314 * - `bottom`: Bottom-aligned
1315 * - `center`: Center-aligned
1316 *
1317 * The default value is `top`.
1318 *
1319 * If the `layout` property of the parent box is `baseline`, the `gravity` property will be ignored.
1320 */
1321 gravity?: "top" | "bottom" | "center";
1322 /**
1323 * Maximum size of the image width.
1324 * The size increases in the order of listing.
1325 * The default value is `md`.
1326 * For more information, see [Image size](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#image-size) in the Messaging API documentation.
1327 */
1328 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl" | "full";
1329 /**
1330 * Aspect ratio of the image. `{width}:{height}` format.
1331 * Specify the value of `{width}` and `{height}` in the range from 1 to 100000. However,
1332 * you cannot set `{height}` to a value that is more than three times the value of `{width}`.
1333 * The default value is `1:1`.
1334 */
1335 aspectRatio?: string;
1336 /**
1337 * Style of the image. Specify one of the following values:
1338 *
1339 * - `cover`: The image fills the entire drawing area. Parts of the image
1340 * that do not fit in the drawing area are not displayed.
1341 * - `fit`: The entire image is displayed in the drawing area. The background
1342 * is displayed in the unused areas to the left and right of vertical images
1343 * and in the areas above and below horizontal images.
1344 *
1345 * The default value is `fit`.
1346 */
1347 aspectMode?: "cover" | "fit";
1348 /**
1349 * Background color of the image. Use a hexadecimal color code.
1350 */
1351 backgroundColor?: string;
1352 /**
1353 * Action performed when this button is tapped.
1354 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1355 */
1356 action?: Action;
1357 /**
1358 * When this is `true`, an animated image (APNG) plays.
1359 * You can specify a value of `true` up to three times in a single message.
1360 * You can't send messages that exceed this limit.
1361 * This is `false` by default.
1362 * Animated images larger than 300 KB aren't played back.
1363 */
1364 animated?: Boolean;
1365} & Offset;
1366/**
1367 * This component draws a video.
1368 */
1369export declare type FlexVideo = {
1370 type: "video";
1371 /**
1372 * Video file URL (Max character limit: 2000)
1373 *
1374 * - Protocol: HTTPS (TLS 1.2 or later)
1375 * - Video format: mp4
1376 * - Maximum data size: 200 MB
1377 */
1378 url: string;
1379 /**
1380 * Preview image URL (Max character limit: 2000)
1381 *
1382 * - Protocol: HTTPS (TLS 1.2 or later)
1383 * - Image format: JPEG or PNG
1384 * - Maximum data size: 1 MB
1385 */
1386 previewUrl: string;
1387 /**
1388 * Alternative content.
1389 *
1390 * The alternative content will be displayed on the screen of a user device
1391 * that is using a version of LINE that doesn't support the video component.
1392 * Specify a box or an image.
1393 *
1394 * - Protocol: HTTPS (TLS 1.2 or later)
1395 * - Image format: JPEG or PNG
1396 * - Maximum data size: 1 MB
1397 */
1398 altContent: FlexBox | FlexImage;
1399 /**
1400 * Aspect ratio of the video. `{width}:{height}` format.
1401 * Specify the value of `{width}` and `{height}` in the range from 1 to 100000. However,
1402 * you cannot set `{height}` to a value that is more than three times the value of `{width}`.
1403 * The default value is `1:1`.
1404 */
1405 aspectRatio?: string;
1406 /**
1407 * Action performed when this button is tapped.
1408 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1409 */
1410 action?: Action;
1411};
1412/**
1413 * This component draws a separator between components in the parent box.
1414 */
1415export declare type FlexSeparator = {
1416 type: "separator";
1417 /**
1418 * Minimum space between this box and the previous component in the parent
1419 * box.
1420 *
1421 * - `none` does not set a space while the other values set a space whose
1422 * size increases in the order of listing.
1423 * - The default value is the value of the `spacing` property of the parent
1424 * box.
1425 * - If this box is the first component in the parent box, the `margin`
1426 * property will be ignored.
1427 */
1428 margin?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1429 /**
1430 * Color of the separator. Use a hexadecimal color code.
1431 */
1432 color?: string;
1433};
1434/**
1435 * This is an invisible component that places a fixed-size space at the
1436 * beginning or end of the box.
1437 * @deprecated
1438 */
1439export declare type FlexSpacer = {
1440 type: "spacer";
1441 /**
1442 * Size of the space.
1443 * The size increases in the order of listing.
1444 * The default value is `md`.
1445 */
1446 size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1447};
1448declare type FlexTextBase = {
1449 type: "text";
1450 /**
1451 * The method by which to adjust the text font size. Specify this value:
1452 *
1453 * - `shrink-to-fit`: Automatically shrink the font
1454 * size to fit the width of the component. This
1455 * property takes a "best-effort" approach that may
1456 * work differently—or not at all!—on some platforms.
1457 * For more information, see [Automatically shrink fonts to fit](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#adjusts-fontsize-to-fit)
1458 * in the Messaging API documentation.
1459 * - LINE 10.13.0 or later for iOS and Android
1460 */
1461 adjustMode?: "shrink-to-fit";
1462 /**
1463 * The ratio of the width or height of this box within the parent box.
1464 *
1465 * The default value for the horizontal parent box is `1`, and the default
1466 * value for the vertical parent box is `0`.
1467 *
1468 * For more information, see
1469 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1470 */
1471 flex?: number;
1472 /**
1473 * Minimum space between this box and the previous component in the parent
1474 * box.
1475 *
1476 * - `none` does not set a space while the other values set a space whose
1477 * size increases in the order of listing.
1478 * - The default value is the value of the `spacing` property of the parent
1479 * box.
1480 * - If this box is the first component in the parent box, the `margin`
1481 * property will be ignored.
1482 */
1483 margin?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1484 /**
1485 * Font size.
1486 * The size increases in the order of listing.
1487 * The default value is `md`.
1488 * For more information, see [Icon, text, and span size](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#other-component-size) in the Messaging API documentation.
1489 */
1490 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl";
1491 /**
1492 * Horizontal alignment style. Specify one of the following values:
1493 *
1494 * - `start`: Left-aligned
1495 * - `end`: Right-aligned
1496 * - `center`: Center-aligned
1497 *
1498 * The default value is `start`.
1499 */
1500 align?: "start" | "end" | "center";
1501 /**
1502 * Vertical alignment style. Specify one of the following values:
1503 *
1504 * - `top`: Top-aligned
1505 * - `bottom`: Bottom-aligned
1506 * - `center`: Center-aligned
1507 *
1508 * The default value is `top`.
1509 *
1510 * If the `layout` property of the parent box is `baseline`, the `gravity`
1511 * property will be ignored.
1512 */
1513 gravity?: "top" | "bottom" | "center";
1514 /**
1515 * `true` to wrap text.
1516 *
1517 * The default value is `false`.
1518 *
1519 * If set to `true`, you can use a new line character (\n) to begin on a new
1520 * line.
1521 */
1522 wrap?: boolean;
1523 /**
1524 * Line spacing in a wrapping text.
1525 *
1526 * Specify a positive integer or decimal number that ends in px.
1527 * The `lineSpacing` property doesn't apply to the top of the start line and the bottom of the last line.
1528 * For more information, see [Increase the line spacing in a text](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/#text-line-spacing) in the Messaging API documentation.
1529 */
1530 lineSpacing?: string;
1531 /**
1532 * Max number of lines. If the text does not fit in the specified number of
1533 * lines, an ellipsis (…) is displayed at the end of the last line. If set to
1534 * 0, all the text is displayed. The default value is 0.
1535 */
1536 maxLines?: number;
1537 /**
1538 * Font weight.
1539 * Specifying `bold`makes the font bold.
1540 * The default value is `regular`.
1541 */
1542 weight?: "regular" | "bold";
1543 /**
1544 * Font color. Use a hexadecimal color code.
1545 */
1546 color?: string;
1547 /**
1548 * Action performed when this text is tapped.
1549 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1550 */
1551 action?: Action;
1552 /**
1553 * Style of the text. Specify one of the following values:
1554 * - `normal`: Normal
1555 * - `italic`: Italic
1556 *
1557 * The default value is `normal`.
1558 */
1559 style?: string;
1560 /**
1561 * Decoration of the text. Specify one of the following values:
1562 * `none`: No decoration
1563 * `underline`: Underline
1564 * `line-through`: Strikethrough
1565 *
1566 * The default value is `none`.
1567 */
1568 decoration?: string;
1569};
1570declare type FlexTextWithText = FlexTextBase & {
1571 text: string;
1572 contents?: never;
1573};
1574declare type FlexTextWithContents = FlexTextBase & {
1575 /**
1576 * Array of spans. Be sure to set either one of the `text` property or `contents` property. If you set the `contents` property, `text` is ignored.
1577 */
1578 contents: FlexSpan[];
1579 text?: never;
1580};
1581export declare type FlexText = (FlexTextWithText | FlexTextWithContents) & Offset;
1582/**
1583 * This component renders multiple text strings with different designs in one row. You can specify the color, size, weight, and decoration for the font. Span is set to `contents` property in [Text](https://developers.line.biz/en/reference/messaging-api/#f-text).
1584 */
1585export declare type FlexSpan = {
1586 type: "span";
1587 /**
1588 * Text. If the `wrap` property of the parent text is set to `true`, you can use a new line character (`\n`) to begin on a new line.
1589 */
1590 text: string;
1591 /**
1592 * Font color. Use a hexadecimal color code.
1593 */
1594 color?: string;
1595 /**
1596 * Font size. You can specify one of the following values: `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `xxl`, `3xl`, `4xl`, or `5xl`. The size increases in the order of listing. The default value is `md`.
1597 * For more information, see [Icon, text, and span size](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#other-component-size) in the Messaging API documentation.
1598 */
1599 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl";
1600 /**
1601 * Font weight. You can specify one of the following values: `regular` or `bold`. Specifying `bold` makes the font bold. The default value is `regular`.
1602 */
1603 weight?: string;
1604 /**
1605 * Style of the text. Specify one of the following values:
1606 * - `normal`: Normal
1607 * - `italic`: Italic
1608 *
1609 * The default value is `normal`.
1610 */
1611 style?: string;
1612 /**
1613 * Decoration of the text. Specify one of the following values:
1614 * `none`: No decoration
1615 * `underline`: Underline
1616 * `line-through`: Strikethrough
1617 *
1618 * The default value is `none`.
1619 *
1620 * Note: The decoration set in the `decoration` property of the [text](https://developers.line.biz/en/reference/messaging-api/#f-text) cannot be overwritten by the `decoration` property of the span.
1621 */
1622 decoration?: string;
1623};
1624export declare type TemplateContent = TemplateButtons | TemplateConfirm | TemplateCarousel | TemplateImageCarousel;
1625/**
1626 * Template with an image, title, text, and multiple action buttons.
1627 *
1628 * Because of the height limitation for buttons template messages, the lower
1629 * part of the text display area will get cut off if the height limitation is
1630 * exceeded. For this reason, depending on the character width, the message
1631 * text may not be fully displayed even when it is within the character limits.
1632 */
1633export declare type TemplateButtons = {
1634 type: "buttons";
1635 /**
1636 * Image URL (Max: 2000 characters)
1637 *
1638 * - HTTPS
1639 * - JPEG or PNG
1640 * - Max width: 1024px
1641 * - Max: 1 MB
1642 */
1643 thumbnailImageUrl?: string;
1644 /**
1645 * Aspect ratio of the image. Specify one of the following values:
1646 *
1647 * - `rectangle`: 1.51:1
1648 * - `square`: 1:1
1649 *
1650 * The default value is `rectangle`
1651 */
1652 imageAspectRatio?: "rectangle" | "square";
1653 /**
1654 * Size of the image. Specify one of the following values:
1655 *
1656 * - `cover`: The image fills the entire image area. Parts of the image that
1657 * do not fit in the area are not displayed.
1658 * - `contain`: The entire image is displayed in the image area. A background
1659 * is displayed in the unused areas to the left and right of vertical images
1660 * and in the areas above and below horizontal images.
1661 *
1662 * The default value is `cover`.
1663 */
1664 imageSize?: "cover" | "contain";
1665 /**
1666 * Background color of image. Specify a RGB color value.
1667 * The default value is `#FFFFFF` (white).
1668 */
1669 imageBackgroundColor?: string;
1670 /**
1671 * Title (Max: 40 characters)
1672 */
1673 title?: string;
1674 /**
1675 * Message text
1676 *
1677 * - Max: 160 characters (no image or title)
1678 * - Max: 60 characters (message with an image or title)
1679 */
1680 text: string;
1681 /**
1682 * Action when tapped (Max: 4)
1683 */
1684 actions: Action[];
1685};
1686/**
1687 * Template with two action buttons.
1688 *
1689 * Because of the height limitation for confirm template messages, the lower
1690 * part of the `text` display area will get cut off if the height limitation is
1691 * exceeded. For this reason, depending on the character width, the message
1692 * text may not be fully displayed even when it is within the character limits.
1693 */
1694export declare type TemplateConfirm = {
1695 type: "confirm";
1696 /**
1697 * Message text (Max: 240 characters)
1698 */
1699 text: string;
1700 /**
1701 * Action when tapped. Set 2 actions for the 2 buttons
1702 */
1703 actions: Action[];
1704};
1705/**
1706 * Template with multiple columns which can be cycled like a carousel.
1707 * The columns will be shown in order by scrolling horizontally.
1708 *
1709 * Because of the height limitation for carousel template messages, the lower
1710 * part of the `text` display area will get cut off if the height limitation is
1711 * exceeded. For this reason, depending on the character width, the message
1712 * text may not be fully displayed even when it is within the character limits.
1713 *
1714 * Keep the number of actions consistent for all columns. If you use an image
1715 * or title for a column, make sure to do the same for all other columns.
1716 */
1717export declare type TemplateCarousel = {
1718 type: "carousel";
1719 /**
1720 * Array of columns (Max: 10)
1721 */
1722 columns: TemplateColumn[];
1723 /**
1724 * Aspect ratio of the image. Specify one of the following values:
1725 *
1726 * - `rectangle`: 1.51:1
1727 * - `square`: 1:1
1728 *
1729 * Applies to all columns. The default value is `rectangle`.
1730 */
1731 imageAspectRatio?: "rectangle" | "square";
1732 /**
1733 * Size of the image. Specify one of the following values:
1734 *
1735 * - `cover`: The image fills the entire image area. Parts of the image that
1736 * do not fit in the area are not displayed.
1737 * - `contain`: The entire image is displayed in the image area. A background
1738 * is displayed in the unused areas to the left and right of vertical images
1739 * and in the areas above and below horizontal images.
1740 *
1741 * Applies to all columns. The default value is `cover`.
1742 */
1743 imageSize?: "cover" | "contain";
1744};
1745export declare type TemplateColumn = {
1746 /**
1747 * Image URL (Max: 2000 characters)
1748 *
1749 * - HTTPS
1750 * - JPEG or PNG
1751 * - Aspect ratio: 1:1.51
1752 * - Max width: 1024px
1753 * - Max: 1 MB
1754 */
1755 thumbnailImageUrl?: string;
1756 /**
1757 * Background color of image. Specify a RGB color value.
1758 * The default value is `#FFFFFF` (white).
1759 */
1760 imageBackgroundColor?: string;
1761 /**
1762 * Title (Max: 40 characters)
1763 */
1764 title?: string;
1765 /**
1766 * Message text
1767 *
1768 * - Max: 120 characters (no image or title)
1769 * - Max: 60 characters (message with an image or title)
1770 */
1771 text: string;
1772 /**
1773 * Action when image is tapped; set for the entire image, title, and text area
1774 */
1775 defaultAction?: Action;
1776 /**
1777 * Action when tapped (Max: 3)
1778 */
1779 actions: Action[];
1780};
1781/**
1782 * Template with multiple images which can be cycled like a carousel.
1783 * The images will be shown in order by scrolling horizontally.
1784 */
1785export declare type TemplateImageCarousel = {
1786 type: "image_carousel";
1787 /**
1788 * Array of columns (Max: 10)
1789 */
1790 columns: TemplateImageColumn[];
1791};
1792export declare type TemplateImageColumn = {
1793 /**
1794 * Image URL (Max: 2000 characters)
1795 *
1796 * - HTTPS
1797 * - JPEG or PNG
1798 * - Aspect ratio: 1:1
1799 * - Max width: 1024px
1800 * - Max: 1 MB
1801 */
1802 imageUrl: string;
1803 /**
1804 * Action when image is tapped
1805 */
1806 action: Action<{
1807 label?: string;
1808 }>;
1809};
1810/**
1811 * These properties are used for the quick reply.
1812 *
1813 * For more information, see
1814 * [Using quick replies](https://developers.line.biz/en/docs/messaging-api/using-quick-reply/).
1815 */
1816export declare type QuickReply = {
1817 /**
1818 * This is a container that contains
1819 * [quick reply buttons](https://developers.line.biz/en/reference/messaging-api/#quick-reply-button-object).
1820 *
1821 * Array of objects (Max: 13)
1822 */
1823 items: QuickReplyItem[];
1824};
1825/**
1826 * This is a quick reply option that is displayed as a button.
1827 *
1828 * For more information, see
1829 * [quick reply buttons](https://developers.line.biz/en/reference/messaging-api/#quick-reply-button-object).
1830 */
1831export declare type QuickReplyItem = {
1832 type: "action";
1833 /**
1834 * URL of the icon that is displayed at the beginning of the button (Max: 1000 characters)
1835 *
1836 * - URL scheme: https
1837 * - Image format: PNG
1838 * - Aspect ratio: 1:1
1839 * - Data size: Up to 1 MB
1840 *
1841 * There is no limit on the image size. If the `action` property has the
1842 * following actions with empty `imageUrl`:
1843 *
1844 * - [camera action](https://developers.line.biz/en/reference/messaging-api/#camera-action)
1845 * - [camera roll action](https://developers.line.biz/en/reference/messaging-api/#camera-roll-action)
1846 * - [location action](https://developers.line.biz/en/reference/messaging-api/#location-action)
1847 *
1848 * the default icon is displayed.
1849 */
1850 imageUrl?: string;
1851 /**
1852 * Action performed when this button is tapped.
1853 *
1854 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1855 *
1856 * The following is a list of the available actions:
1857 *
1858 * - [Postback action](https://developers.line.biz/en/reference/messaging-api/#postback-action)
1859 * - [Message action](https://developers.line.biz/en/reference/messaging-api/#message-action)
1860 * - [Datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action)
1861 * - [Camera action](https://developers.line.biz/en/reference/messaging-api/#camera-action)
1862 * - [Camera roll action](https://developers.line.biz/en/reference/messaging-api/#camera-roll-action)
1863 * - [Location action](https://developers.line.biz/en/reference/messaging-api/#location-action)
1864 * - [URI action](https://developers.line.biz/en/reference/messaging-api/#uri-action)
1865 */
1866 action: Action;
1867};
1868export declare type Sender = {
1869 /**
1870 * Display name
1871 *
1872 * - Max character limit: 20
1873 * - Certain words such as `LINE` may not be used.
1874 */
1875 name?: string;
1876 /**
1877 * Icon image URL
1878 *
1879 * - Max character limit: 1000
1880 * - URL scheme: https
1881 */
1882 iconUrl?: string;
1883};
1884/**
1885 * These are types of actions for your bot to take when a user taps a button or an image in a message.
1886 *
1887 * - [Postback action](https://developers.line.biz/en/reference/messaging-api/#postback-action)
1888 * - [Message action](https://developers.line.biz/en/reference/messaging-api/#message-action)
1889 * - [URI action](https://developers.line.biz/en/reference/messaging-api/#uri-action)
1890 * - [Datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action)
1891 * - [Rich menu switch action](https://developers.line.biz/en/reference/messaging-api/#richmenu-switch-action)
1892 * - [Camera action](https://developers.line.biz/en/reference/messaging-api/#camera-action)
1893 * - [Camera roll action](https://developers.line.biz/en/reference/messaging-api/#camera-roll-action)
1894 * - [Location action](https://developers.line.biz/en/reference/messaging-api/#location-action)
1895 */
1896export declare type Action<ExtraFields = {
1897 label: string;
1898}> = (PostbackAction | MessageAction | URIAction | DatetimePickerAction | RichMenuSwitchAction | {
1899 type: "camera";
1900} | {
1901 type: "cameraRoll";
1902} | {
1903 type: "location";
1904}) & ExtraFields;
1905/**
1906 * When a control associated with this action is tapped, a postback event is
1907 * returned via webhook with the specified string in the data property.
1908 */
1909export declare type PostbackAction = {
1910 type: "postback";
1911 /**
1912 * String returned via webhook in the `postback.data` property of the
1913 * postback event (Max: 300 characters)
1914 */
1915 data: string;
1916 /**
1917 * Text displayed in the chat as a message sent by the user when the action
1918 * is performed. Returned from the server through a webhook.
1919 *
1920 * - This property cannot be used with quick reply buttons. (Max: 300 characters)
1921 * - The `displayText` and `text` properties cannot both be used at the same time.
1922 * @deprecated
1923 */
1924 text?: string;
1925 /**
1926 * Text displayed in the chat as a message sent by the user when the action is performed.
1927 *
1928 * - Required for quick reply buttons.
1929 * - Optional for the other message types.
1930 *
1931 * Max: 300 characters
1932 *
1933 * The `displayText` and `text` properties cannot both be used at the same time.
1934 */
1935 displayText?: string;
1936};
1937/**
1938 * When a control associated with this action is tapped, the string in the text
1939 * property is sent as a message from the user.
1940 */
1941export declare type MessageAction = {
1942 type: "message";
1943 /**
1944 * Text sent when the action is performed (Max: 300 characters)
1945 */
1946 text: string;
1947};
1948/**
1949 * When a control associated with this action is tapped, the URI specified in
1950 * the `uri` property is opened.
1951 */
1952export declare type URIAction = {
1953 type: "uri";
1954 /**
1955 * URI opened when the action is performed (Max: 1000 characters).
1956 * Must start with `http`, `https`, or `tel`.
1957 */
1958 uri: string;
1959 altUri?: AltURI;
1960};
1961/**
1962 * URI opened on LINE for macOS and Windows when the action is performed (Max: 1000 characters)
1963 * If the altUri.desktop property is set, the uri property is ignored on LINE for macOS and Windows.
1964 * The available schemes are http, https, line, and tel.
1965 * For more information about the LINE URL scheme, see Using the LINE URL scheme.
1966 * This property is supported on the following version of LINE.
1967 *
1968 * LINE 5.12.0 or later for macOS and Windows
1969 * Note: The altUri.desktop property is supported only when you set URI actions in Flex Messages.
1970 */
1971export declare type AltURI = {
1972 desktop: string;
1973};
1974/**
1975 * When a control associated with this action is tapped, a
1976 * [postback event](https://developers.line.biz/en/reference/messaging-api/#postback-event)
1977 * is returned via webhook with the date and time selected by the user from the
1978 * date and time selection dialog.
1979 *
1980 * The datetime picker action does not support time zones.
1981 *
1982 * #### Date and time format
1983 *
1984 * The date and time formats for the `initial`, `max`, and `min` values are
1985 * shown below. The `full-date`, `time-hour`, and `time-minute` formats follow
1986 * the [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) protocol.
1987 *
1988 * | Mode | Format | Example |
1989 * | -------- | ------------------------------------------------------------ | -------------------------------- |
1990 * | date | `full-date` (Max: 2100-12-31; Min: 1900-01-01) | 2017-06-18 |
1991 * | time | `time-hour`:`time-minute` (Max: 23:59; Min: 00:00) | 00:0006:1523:59 |
1992 * | datetime | `full-date`T`time-hour`:`time-minute` or `full-date`t`time-hour`:`time-minute` (Max: 2100-12-31T23:59; Min: 1900-01-01T00:00) | 2017-06-18T06:152017-06-18t06:15 |
1993 */
1994export declare type DatetimePickerAction = {
1995 type: "datetimepicker";
1996 /**
1997 * String returned via webhook in the `postback.data` property of the
1998 * postback event (Max: 300 characters)
1999 */
2000 data: string;
2001 mode: "date" | "time" | "datetime";
2002 /**
2003 * Initial value of date or time
2004 */
2005 initial?: string;
2006 /**
2007 * Largest date or time value that can be selected. Must be greater than the
2008 * `min` value.
2009 */
2010 max?: string;
2011 /**
2012 * Smallest date or time value that can be selected. Must be less than the
2013 * `max` value.
2014 */
2015 min?: string;
2016};
2017export declare type Size = {
2018 width: number;
2019 height: number;
2020};
2021/**
2022 * When a control associated with this action is tapped, the URI specified in
2023 * the `uri` property is opened.
2024 */
2025export declare type RichMenuSwitchAction = {
2026 type: "richmenuswitch";
2027 /**
2028 * Action label. Optional for rich menus. Read when the user's device accessibility feature is enabled.
2029 * Max character limit: 20. Supported on LINE for iOS 8.2.0 or later.
2030 */
2031 label?: string;
2032 /**
2033 * Rich menu alias ID to switch to.
2034 */
2035 richMenuAliasId: string;
2036 /**
2037 * String returned by the postback.data property of the postback event via a webhook
2038 * Max character limit: 300
2039 */
2040 data: string;
2041};
2042/**
2043 * Rich menus consist of either of these objects.
2044 *
2045 * - [Rich menu object](https://developers.line.biz/en/reference/messaging-api/#rich-menu-object)
2046 * without the rich menu ID. Use this object when you
2047 * [create a rich menu](https://developers.line.biz/en/reference/messaging-api/#create-rich-menu).
2048 * - [Rich menu response object](https://developers.line.biz/en/reference/messaging-api/#rich-menu-response-object)
2049 * with the rich menu ID. This object is returned when you
2050 * [get a rich menu](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu)
2051 * or [get a list of rich menus](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list).
2052 *
2053 * [Area objects](https://developers.line.biz/en/reference/messaging-api/#area-object) and
2054 * [action objects](https://developers.line.biz/en/reference/messaging-api/#action-objects)
2055 * are included in these objects.
2056 */
2057export declare type RichMenu = {
2058 /**
2059 * [`size` object](https://developers.line.biz/en/reference/messaging-api/#size-object)
2060 * which contains the width and height of the rich menu displayed in the chat.
2061 * Rich menu images must be one of the following sizes: 2500x1686px or 2500x843px.
2062 */
2063 size: Size;
2064 /**
2065 * `true` to display the rich menu by default. Otherwise, `false`.
2066 */
2067 selected: boolean;
2068 /**
2069 * Name of the rich menu.
2070 *
2071 * This value can be used to help manage your rich menus and is not displayed
2072 * to users.
2073 *
2074 * (Max: 300 characters)
2075 */
2076 name: string;
2077 /**
2078 * Text displayed in the chat bar (Max: 14 characters)
2079 */
2080 chatBarText: string;
2081 /**
2082 * Array of [area objects](https://developers.line.biz/en/reference/messaging-api/#area-object)
2083 * which define the coordinates and size of tappable areas
2084 * (Max: 20 area objects)
2085 */
2086 areas: Array<{
2087 bounds: Area;
2088 action: Action<{
2089 label?: string;
2090 }>;
2091 }>;
2092};
2093export declare type RichMenuResponse = {
2094 richMenuId: string;
2095} & RichMenu;
2096export declare type NumberOfMessagesSentResponse = InsightStatisticsResponse & {
2097 /**
2098 * The number of messages sent with the Messaging API on the date specified in date.
2099 * The response has this property only when the value of status is `ready`.
2100 */
2101 success?: number;
2102};
2103export declare type TargetLimitForAdditionalMessages = {
2104 /**
2105 * One of the following values to indicate whether a target limit is set or not.
2106 * - `none`: This indicates that a target limit is not set.
2107 * - `limited`: This indicates that a target limit is set.
2108 */
2109 type: "none" | "limited";
2110 /**
2111 * The target limit for additional messages in the current month.
2112 * This property is returned when the `type` property has a value of `limited`.
2113 */
2114 value?: number;
2115};
2116export declare type NumberOfMessagesSentThisMonth = {
2117 /**
2118 * The number of sent messages in the current month
2119 */
2120 totalUsage: number;
2121};
2122export declare const LINE_REQUEST_ID_HTTP_HEADER_NAME = "x-line-request-id";
2123export declare type MessageAPIResponseBase = {
2124 [LINE_REQUEST_ID_HTTP_HEADER_NAME]?: string;
2125};
2126export declare const LINE_SIGNATURE_HTTP_HEADER_NAME = "x-line-signature";
2127export declare type InsightStatisticsResponse = {
2128 /**
2129 * Calculation status. One of:
2130 * - `ready`: Calculation has finished; the numbers are up-to-date.
2131 * - `unready`: We haven't finished calculating the number of sent messages for the specified `date`. Calculation usually takes about a day. Please try again later.
2132 * - `out_of_service`: The specified `date` is earlier than the date on which we first started calculating sent messages. Different APIs have different date. Check them at the [document](https://developers.line.biz/en/reference/messaging-api/).
2133 */
2134 status: "ready" | "unready" | "out_of_service";
2135};
2136export declare type NumberOfMessageDeliveries = InsightStatisticsResponse & {
2137 /**
2138 * Number of push messages sent to **all** of this LINE official account's friends (broadcast messages).
2139 */
2140 broadcast: number;
2141 /**
2142 * Number of push messages sent to **some** of this LINE official account's friends, based on specific attributes (targeted/segmented messages).
2143 */
2144 targeting: number;
2145 /**
2146 * Number of auto-response messages sent.
2147 */
2148 autoResponse: number;
2149 /**
2150 * Number of greeting messages sent.
2151 */
2152 welcomeResponse: number;
2153 /**
2154 * Number of messages sent from LINE Official Account Manager [Chat screen](https://www.linebiz.com/jp-en/manual/OfficialAccountManager/chats/screens/).
2155 */
2156 chat: number;
2157 /**
2158 * Number of broadcast messages sent with the [Send broadcast message](https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message) Messaging API operation.
2159 */
2160 apiBroadcast: number;
2161 /**
2162 * Number of push messages sent with the [Send push message](https://developers.line.biz/en/reference/messaging-api/#send-push-message) Messaging API operation.
2163 */
2164 apiPush: number;
2165 /**
2166 * Number of multicast messages sent with the [Send multicast message](https://developers.line.biz/en/reference/messaging-api/#send-multicast-message) Messaging API operation.
2167 */
2168 apiMulticast: number;
2169 /**
2170 * Number of replies sent with the [Send reply message](https://developers.line.biz/en/reference/messaging-api/#send-reply-message) Messaging API operation.
2171 */
2172 apiReply: number;
2173};
2174export declare type NumberOfFollowers = InsightStatisticsResponse & {
2175 /**
2176 * The number of times, as of the specified `date`, that a user added this LINE official account as a friend. The number doesn't decrease when a user blocks the account after adding it, or when they delete their own account.
2177 */
2178 followers: Number;
2179 /**
2180 * The number of users, as of the specified `date`, that the official account can reach with messages targeted by gender, age, or area. This number includes users for whom we estimated demographic attributes based on their activity in LINE and LINE-connected services.
2181 */
2182 targetedReaches: Number;
2183 /**
2184 * The number of users blocking the account as of the specified `date`. The number decreases when a user unblocks the account.
2185 */
2186 blocks: Number;
2187};
2188export declare type NumberOfMessageDeliveriesResponse = InsightStatisticsResponse | NumberOfMessageDeliveries;
2189export declare type NumberOfFollowersResponse = InsightStatisticsResponse | NumberOfFollowers;
2190declare type PercentageAble = {
2191 percentage: number;
2192};
2193export declare type FriendDemographics = {
2194 /**
2195 * `true` if friend demographic information is available.
2196 */
2197 available: boolean;
2198 /**
2199 * Percentage per gender
2200 */
2201 genders?: Array<{
2202 /**
2203 * Gender
2204 */
2205 gender: "unknown" | "male" | "female";
2206 } & PercentageAble>;
2207 /**
2208 * Percentage per age group
2209 */
2210 ages?: Array<{
2211 /**
2212 * Age group
2213 */
2214 age: string;
2215 } & PercentageAble>;
2216 /**
2217 * Percentage per area
2218 */
2219 areas?: Array<{
2220 area: string;
2221 } & PercentageAble>;
2222 /**
2223 * Percentage by OS
2224 */
2225 appTypes?: Array<{
2226 appType: "ios" | "android" | "others";
2227 } & PercentageAble>;
2228 /**
2229 * Percentage per friendship duration
2230 */
2231 subscriptionPeriods?: Array<{
2232 /**
2233 * Friendship duration
2234 */
2235 subscriptionPeriod: "over365days" | "within365days" | "within180days" | "within90days" | "within30days" | "within7days" | "unknown";
2236 } & PercentageAble>;
2237};
2238declare type UserInteractionStatisticsOfEachMessage = {
2239 seq: number;
2240 impression: number;
2241 mediaPlayed: number;
2242 mediaPlayed25Percent: number;
2243 mediaPlayed50Percent: number;
2244 mediaPlayed75Percent: number;
2245 mediaPlayed100Percent: number;
2246 uniqueMediaPlayed: number;
2247 uniqueMediaPlayed25Percent: number;
2248 uniqueMediaPlayed50Percent: number;
2249 uniqueMediaPlayed75Percent: number;
2250 uniqueMediaPlayed100Percent: number;
2251};
2252declare type UserInteractionStatisticsOfEachURL = {
2253 seq: number;
2254 url: number;
2255 click: number;
2256 uniqueClick: number;
2257 uniqueClickOfRequest: number;
2258};
2259/**
2260 * https://developers.line.biz/en/reference/messaging-api/#get-message-event
2261 */
2262export declare type UserInteractionStatistics = {
2263 overview: {
2264 requestId: string;
2265 timestamp: number;
2266 delivered: number;
2267 uniqueImpression: number;
2268 uniqueClick: number;
2269 uniqueMediaPlayed: number;
2270 uniqueMediaPlayed100Percent: number;
2271 };
2272 messages: UserInteractionStatisticsOfEachMessage[];
2273 clicks: UserInteractionStatisticsOfEachURL[];
2274};
2275declare type FilterOperatorObject<T> = {
2276 type: "operator";
2277} & ({
2278 and: (T | FilterOperatorObject<T>)[];
2279} | {
2280 or: (T | FilterOperatorObject<T>)[];
2281} | {
2282 not: T | (T | FilterOperatorObject<T>)[];
2283});
2284declare type AudienceObject = {
2285 type: "audience";
2286 audienceGroupId: number;
2287};
2288declare type RedeliveryObject = {
2289 type: "redelivery";
2290 requestId: string;
2291};
2292export declare type ReceieptObject = AudienceObject | RedeliveryObject | FilterOperatorObject<AudienceObject> | FilterOperatorObject<RedeliveryObject>;
2293declare type DemographicAge = "age_15" | "age_20" | "age_25" | "age_30" | "age_35" | "age_40" | "age_45" | "age_50";
2294declare type DemographicSubscriptionPeriod = "day_7" | "day_30" | "day_90" | "day_180" | "day_365";
2295declare type DemographicArea = "jp_01" | "jp_02" | "jp_03" | "jp_04" | "jp_05" | "jp_06" | "jp_07" | "jp_08" | "jp_09" | "jp_10" | "jp_11" | "jp_12" | "jp_13" | "jp_14" | "jp_15" | "jp_16" | "jp_17" | "jp_18" | "jp_19" | "jp_20" | "jp_21" | "jp_22" | "jp_23" | "jp_24" | "jp_25" | "jp_26" | "jp_27" | "jp_28" | "jp_29" | "jp_30" | "jp_31" | "jp_32" | "jp_33" | "jp_34" | "jp_35" | "jp_36" | "jp_37" | "jp_38" | "jp_39" | "jp_40" | "jp_41" | "jp_42" | "jp_43" | "jp_44" | "jp_45" | "jp_46" | "jp_47" | "tw_01" | "tw_02" | "tw_03" | "tw_04" | "tw_05" | "tw_06" | "tw_07" | "tw_08" | "tw_09" | "tw_10" | "tw_11" | "tw_12" | "tw_13" | "tw_14" | "tw_15" | "tw_16" | "tw_17" | "tw_18" | "tw_19" | "tw_20" | "tw_21" | "tw_22" | "th_01" | "th_02" | "th_03" | "th_04" | "th_05" | "th_06" | "th_07" | "th_08" | "id_01" | "id_02" | "id_03" | "id_04" | "id_06" | "id_07" | "id_08" | "id_09" | "id_10" | "id_11" | "id_12" | "id_05";
2296declare type DemographicObject = {
2297 type: "gender";
2298 oneOf: ("male" | "female")[];
2299} | {
2300 type: "age";
2301 gte?: DemographicAge;
2302 lt?: DemographicAge;
2303} | {
2304 type: "appType";
2305 oneOf: ("ios" | "android")[];
2306} | {
2307 type: "area";
2308 oneOf: DemographicArea[];
2309} | {
2310 type: "subscriptionPeriod";
2311 gte?: DemographicSubscriptionPeriod;
2312 lt?: DemographicSubscriptionPeriod;
2313};
2314export declare type DemographicFilterObject = DemographicObject | FilterOperatorObject<DemographicObject>;
2315export declare type NarrowcastProgressResponse = ({
2316 phase: "waiting";
2317} | (({
2318 phase: "sending" | "succeeded";
2319} | {
2320 phase: "failed";
2321 failedDescription: string;
2322}) & {
2323 successCount: number;
2324 failureCount: number;
2325 targetCount: string;
2326 acceptedTime: string;
2327 completedTime: string;
2328})) & {
2329 errorCode?: 1 | 2;
2330};
2331declare type AudienceGroupJob = {
2332 audienceGroupJobId: number;
2333 audienceGroupId: number;
2334 description: string;
2335 type: "DIFF_ADD";
2336 audienceCount: number;
2337 created: number;
2338} & ({
2339 jobStatus: "QUEUED" | "WORKING" | "FINISHED";
2340} | {
2341 jobStatus: "FAILED";
2342 failedType: "INTERNAL_ERROR";
2343});
2344export declare type AudienceGroupStatus = "IN_PROGRESS" | "READY" | "EXPIRED" | "FAILED";
2345export declare type AudienceGroupCreateRoute = "OA_MANAGER" | "MESSAGING_API";
2346declare type _AudienceGroup = {
2347 audienceGroupId: number;
2348 description: string;
2349 audienceCount: number;
2350 created: number;
2351 isIfaAudience: boolean;
2352 permission: "READ" | "READ_WRITE";
2353 createRoute: AudienceGroupCreateRoute;
2354} & ({
2355 status: Exclude<AudienceGroupStatus, "FAILED">;
2356} | {
2357 status: "FAILED";
2358 failedType: "AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT" | "INTERNAL_ERROR";
2359}) & ({
2360 type: "UPLOAD";
2361} | {
2362 type: "CLICK";
2363 clickUrl: string;
2364} | {
2365 type: "IMP";
2366 requestId: string;
2367});
2368export declare type AudienceGroup = _AudienceGroup & {
2369 jobs: AudienceGroupJob[];
2370};
2371export declare type AudienceGroups = _AudienceGroup[];
2372export declare type AudienceGroupAuthorityLevel = "PUBLIC" | "PRIVATE";
2373export declare type ChannelAccessToken = {
2374 access_token: string;
2375 expires_in: number;
2376 token_type: "Bearer";
2377 key_id?: string;
2378};
2379export declare type VerifyAccessToken = {
2380 scope: string;
2381 client_id: string;
2382 expires_in: number;
2383};
2384export declare type VerifyIDToken = {
2385 scope: string;
2386 client_id: string;
2387 expires_in: number;
2388 iss: string;
2389 sub: string;
2390 aud: number;
2391 exp: number;
2392 iat: number;
2393 nonce: string;
2394 amr: string[];
2395 name: string;
2396 picture: string;
2397 email: string;
2398};
2399/**
2400 * Response body of get group summary.
2401 *
2402 * @see [Get group summary](https://developers.line.biz/ja/reference/messaging-api/#get-group-summary)
2403 */
2404export declare type GroupSummaryResponse = {
2405 groupId: string;
2406 groupName: string;
2407 pictureUrl: string;
2408};
2409/**
2410 * Response body of get members in group count and get members in room count.
2411 *
2412 * @see [Get members in group count](https://developers.line.biz/en/reference/messaging-api/#get-members-group-count)
2413 * @see [Get members in room count](https://developers.line.biz/en/reference/messaging-api/#get-members-room-count)
2414 */
2415export declare type MembersCountResponse = {
2416 count: number;
2417};
2418export declare type GetRichMenuAliasResponse = {
2419 richMenuAliasId: string;
2420 richMenuId: string;
2421};
2422export declare type GetRichMenuAliasListResponse = {
2423 aliases: GetRichMenuAliasResponse[];
2424};
2425/**
2426 * Response body of get bot info.
2427 *
2428 * @see [Get bot info](https://developers.line.biz/en/reference/messaging-api/#get-bot-info)
2429 */
2430export declare type BotInfoResponse = {
2431 userId: string;
2432 basicId: string;
2433 premiumId?: string;
2434 displayName: string;
2435 pictureUrl?: string;
2436 chatMode: "chat" | "bot";
2437 markAsReadMode: "auto" | "manual";
2438};
2439/**
2440 * Response body of get webhook endpoint info.
2441 *
2442 * @see [Get get webhook endpoint info](https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information)
2443 */
2444export declare type WebhookEndpointInfoResponse = {
2445 endpoint: string;
2446 active: boolean;
2447};
2448/**
2449 * Response body of test webhook endpoint.
2450 *
2451 * @see [Test webhook endpoint](https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint)
2452 */
2453export declare type TestWebhookEndpointResponse = {
2454 success: boolean;
2455 timestamp: string;
2456 statusCode: number;
2457 reason: string;
2458 detail: string;
2459};
2460export {};