UNPKG

86.7 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} & EventMessageBase;
409/**
410 * Message object which contains the video content sent from the source.
411 * The binary video data can be retrieved using Client#getMessageContent.
412 */
413export declare type VideoEventMessage = {
414 type: "video";
415 contentProvider: ContentProvider;
416} & EventMessageBase;
417/**
418 * Message object which contains the audio content sent from the source.
419 * The binary audio data can be retrieved using Client#getMessageContent.
420 */
421export declare type AudioEventMessage = {
422 type: "audio";
423 duration: number;
424 contentProvider: ContentProvider<false>;
425} & EventMessageBase;
426/**
427 * Message object which contains the file sent from the source.
428 * The binary data can be retrieved using Client#getMessageContent.
429 */
430export declare type FileEventMessage = {
431 type: "file";
432 fileName: string;
433 fileSize: string;
434} & EventMessageBase;
435/**
436 * Message object which contains the location data sent from the source.
437 */
438export declare type LocationEventMessage = {
439 type: "location";
440 title: string;
441 address: string;
442 latitude: number;
443 longitude: number;
444} & EventMessageBase;
445/**
446 * Message object which contains the sticker data sent from the source.
447 * For a list of basic LINE stickers and sticker IDs, see
448 * [sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
449 */
450export declare type StickerEventMessage = {
451 type: "sticker";
452 packageId: string;
453 stickerId: string;
454 stickerResourceType: "STATIC" | "ANIMATION" | "SOUND" | "ANIMATION_SOUND" | "POPUP" | "POPUP_SOUND" | "NAME_TEXT" | "PER_STICKER_TEXT";
455 keywords: string[];
456} & EventMessageBase;
457export declare type Postback = {
458 data: string;
459 params?: DateTimePostback | RichMenuSwitchPostback;
460};
461/**
462 * Object with the date and time selected by a user through a
463 * [datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action).
464 * Only returned for postback actions via a
465 * [datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action).
466 * The `full-date`, `time-hour`, and `time-minute` formats follow the
467 * [RFC3339 protocol](https://www.ietf.org/rfc/rfc3339.txt).
468 */
469declare type DateTimePostback = {
470 /**
471 * Date selected by user. Only included in the `date` mode.
472 */
473 date?: string;
474 /**
475 * Time selected by the user. Only included in the `time` mode.
476 */
477 time?: string;
478 /**
479 * Date and time selected by the user. Only included in the `datetime` mode.
480 */
481 datetime?: string;
482};
483/**
484 * Object with rich menu alias ID selected by user via rich menu switch action.
485 * https://developers.line.biz/en/reference/messaging-api/#postback-params-object-for-richmenu-switch-action
486 */
487declare type RichMenuSwitchPostback = {
488 newRichMenuAliasId: string;
489 status: "SUCCESS" | "RICHMENU_ALIAS_ID_NOTFOUND" | "RICHMENU_NOTFOUND" | "FAILED";
490};
491/**
492 * JSON object which contains the contents of the message you send.
493 *
494 * @see [Message objects](https://developers.line.biz/en/reference/messaging-api/#message-objects)
495 */
496export declare type Message = TextMessage | ImageMessage | VideoMessage | AudioMessage | LocationMessage | StickerMessage | ImageMapMessage | TemplateMessage | FlexMessage;
497/**
498 * @see [Common properties for messages](https://developers.line.biz/en/reference/messaging-api/#common-properties-for-messages)
499 */
500export declare type MessageCommon = {
501 /**
502 * For the quick reply feature.
503 * For more information, see [Using quick replies](https://developers.line.biz/en/docs/messaging-api/using-quick-reply/).
504 *
505 * If the user receives multiple
506 * [message objects](https://developers.line.biz/en/reference/messaging-api/#message-objects),
507 * the quickReply property of the last message object is displayed.
508 */
509 quickReply?: QuickReply;
510 /**
511 * [Change icon and display name](https://developers.line.biz/en/docs/messaging-api/icon-nickname-switch/)
512 *
513 * 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).
514 */
515 sender?: Sender;
516};
517/**
518 * @see [Text message](https://developers.line.biz/en/reference/messaging-api/#text-message)
519 */
520export declare type TextMessage = MessageCommon & {
521 type: "text";
522 /**
523 * Message text. You can include the following emoji:
524 *
525 * - 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.
526 * - Unicode emoji
527 * - (Deprecated) LINE original unicode emojis
528 * ([Unicode codepoint table for LINE original emoji](https://developers.line.biz/media/messaging-api/emoji-list.pdf))
529 *
530 * Max: 5000 characters
531 */
532 text: string;
533 /**
534 * One or more LINE emoji.
535 *
536 * Max: 20 LINE emoji
537 */
538 emojis?: {
539 index: number;
540 productId: string;
541 emojiId: string;
542 }[];
543};
544/**
545 * @see [Image message](https://developers.line.biz/en/reference/messaging-api/#image-message)
546 */
547export declare type ImageMessage = MessageCommon & {
548 type: "image";
549 /**
550 * Image URL (Max: 2000 characters)
551 *
552 * - **HTTPS**
553 * - JPEG
554 * - Max: 1024 x 1024
555 * - Max: 1 MB
556 */
557 originalContentUrl: string;
558 /**
559 * Preview image URL (Max: 2000 characters)
560 *
561 * - **HTTPS**
562 * - JPEG
563 * - Max: 240 x 240
564 * - Max: 1 MB
565 */
566 previewImageUrl: string;
567};
568/**
569 * @see [Video message](https://developers.line.biz/en/reference/messaging-api/#video-message)
570 */
571export declare type VideoMessage = MessageCommon & {
572 type: "video";
573 /**
574 * URL of video file (Max: 2000 characters)
575 *
576 * - **HTTPS**
577 * - mp4
578 * - Max: 1 minute
579 * - Max: 10 MB
580 *
581 * A very wide or tall video may be cropped when played in some environments.
582 */
583 originalContentUrl: string;
584 /**
585 * URL of preview image (Max: 2000 characters)
586 *
587 * - **HTTPS**
588 * - JPEG
589 * - Max: 240 x 240
590 * - Max: 1 MB
591 */
592 previewImageUrl: string;
593};
594/**
595 * @see [Audio message](https://developers.line.biz/en/reference/messaging-api/#audio-message)
596 */
597export declare type AudioMessage = MessageCommon & {
598 type: "audio";
599 /**
600 * URL of audio file (Max: 2000 characters)
601 *
602 * - **HTTPS**
603 * - m4a
604 * - Max: 1 minute
605 * - Max: 10 MB
606 */
607 originalContentUrl: string;
608 /**
609 * Length of audio file (milliseconds)
610 */
611 duration: number;
612};
613/**
614 * @see [Location message](https://developers.line.biz/en/reference/messaging-api/#location-message)
615 */
616export declare type LocationMessage = MessageCommon & {
617 type: "location";
618 /**
619 * Title (Max: 100 characters)
620 */
621 title: string;
622 /**
623 * Address (Max: 100 characters)
624 */
625 address: string;
626 latitude: number;
627 longitude: number;
628};
629/**
630 * @see [Sticker message](https://developers.line.biz/en/reference/messaging-api/#sticker-message)
631 */
632export declare type StickerMessage = MessageCommon & {
633 type: "sticker";
634 /**
635 * Package ID for a set of stickers.
636 * For information on package IDs, see the
637 * [Sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
638 */
639 packageId: string;
640 /**
641 * Sticker ID.
642 * For a list of sticker IDs for stickers that can be sent with the Messaging
643 * API, see the
644 * [Sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
645 */
646 stickerId: string;
647};
648/**
649 * @see [Imagemap message](https://developers.line.biz/en/reference/messaging-api/#imagemap-message)
650 */
651export declare type ImageMapMessage = MessageCommon & {
652 type: "imagemap";
653 /**
654 * [Base URL](https://developers.line.biz/en/reference/messaging-api/#base-url) of image
655 * (Max: 2000 characters, **HTTPS**)
656 */
657 baseUrl: string;
658 /**
659 * Alternative text (Max: 400 characters)
660 */
661 altText: string;
662 baseSize: Size;
663 /**
664 * Video to play inside a image map messages
665 */
666 video?: {
667 /**
668 * URL of video file (Max: 2000 characters)
669 *
670 * - **HTTPS**
671 * - mp4
672 * - Max: 1 minute
673 * - Max: 10 MB
674 *
675 * A very wide or tall video may be cropped when played in some environments.
676 */
677 originalContentUrl: string;
678 /**
679 * URL of preview image (Max: 2000 characters)
680 *
681 * - **HTTPS**
682 * - JPEG
683 * - Max: 240 x 240
684 * - Max: 1 MB
685 */
686 previewImageUrl: string;
687 area: Area;
688 /**
689 * External link to be displayed after a video is played
690 * This property is required if you set a video to play and a label to display after the video on the imagemap
691 */
692 externalLink?: {
693 linkUri: string;
694 label: string;
695 };
696 };
697 /**
698 * Action when tapped (Max: 50)
699 */
700 actions: ImageMapAction[];
701};
702/**
703 * Template messages are messages with predefined layouts which you can
704 * customize. For more information, see
705 * [template messages](https://developers.line.biz/en/docs/messaging-api/message-types/#template-messages).
706 *
707 * The following template types are available:
708 *
709 * - [Buttons](https://developers.line.biz/en/reference/messaging-api/#buttons)
710 * - [Confirm](https://developers.line.biz/en/reference/messaging-api/#confirm)
711 * - [Carousel](https://developers.line.biz/en/reference/messaging-api/#carousel)
712 * - [Image carousel](https://developers.line.biz/en/reference/messaging-api/#image-carousel)
713 *
714 * @see [Template messages](https://developers.line.biz/en/reference/messaging-api/#template-messages)
715 */
716export declare type TemplateMessage = MessageCommon & {
717 type: "template";
718 /**
719 * Alternative text (Max: 400 characters)
720 */
721 altText: string;
722 /**
723 * Carousel template content
724 */
725 template: TemplateContent;
726};
727/**
728 * Flex Messages are messages with a customizable layout.
729 * You can customize the layout freely by combining multiple elements.
730 * For more information, see
731 * [Using Flex Messages](https://developers.line.biz/en/docs/messaging-api/using-flex-messages/).
732 *
733 * @see [Flex messages](https://developers.line.biz/en/reference/messaging-api/#flex-message)
734 */
735export declare type FlexMessage = MessageCommon & {
736 type: "flex";
737 altText: string;
738 contents: FlexContainer;
739};
740/**
741 * Object which specifies the actions and tappable regions of an imagemap.
742 *
743 * When a region is tapped, the user is redirected to the URI specified in
744 * `uri` and the message specified in `message` is sent.
745 *
746 * @see [Imagemap action objects](https://developers.line.biz/en/reference/messaging-api/#imagemap-action-objects)
747 */
748export declare type ImageMapAction = ImageMapURIAction | ImageMapMessageAction;
749export declare type ImageMapActionBase = {
750 /**
751 * Spoken when the accessibility feature is enabled on the client device. (Max: 50 characters)
752 * Supported on LINE 8.2.0 and later for iOS.
753 */
754 label?: string;
755 /** Defined tappable area */
756 area: Area;
757};
758export declare type ImageMapURIAction = {
759 type: "uri";
760 /**
761 * Webpage URL (Max: 1000 characters)
762 */
763 linkUri: string;
764} & ImageMapActionBase;
765export declare type ImageMapMessageAction = {
766 type: "message";
767 /**
768 * Message to send (Max: 400 characters)
769 */
770 text: string;
771} & ImageMapActionBase;
772export declare type Area = {
773 /**
774 * Horizontal position relative to the top-left corner of the area
775 */
776 x: number;
777 /**
778 * Vertical position relative to the top-left corner of the area
779 */
780 y: number;
781 /**
782 * Width of the tappable area
783 */
784 width: number;
785 /**
786 * Height of the tappable area
787 */
788 height: number;
789};
790/**
791 * A container is the top-level structure of a Flex Message. Here are the types of containers available.
792 *
793 * - [Bubble](https://developers.line.biz/en/reference/messaging-api/#bubble)
794 * - [Carousel](https://developers.line.biz/en/reference/messaging-api/#f-carousel)
795 *
796 * See [Flex Message elements](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/)
797 * for the containers' JSON data samples and usage.
798 */
799export declare type FlexContainer = FlexBubble | FlexCarousel;
800/**
801 * This is a container that contains one message bubble. It can contain four
802 * blocks: header, hero, body, and footer.
803 *
804 * For more information about using each block, see
805 * [Block](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/#block).
806 */
807export declare type FlexBubble = {
808 type: "bubble";
809 size?: "nano" | "micro" | "kilo" | "mega" | "giga";
810 /**
811 * Text directionality and the order of components in horizontal boxes in the
812 * container. Specify one of the following values:
813 *
814 * - `ltr`: Left to right
815 * - `rtl`: Right to left
816 *
817 * The default value is `ltr`.
818 */
819 direction?: "ltr" | "rtl";
820 header?: FlexBox;
821 hero?: FlexBox | FlexImage;
822 body?: FlexBox;
823 footer?: FlexBox;
824 styles?: FlexBubbleStyle;
825 action?: Action;
826};
827export declare type FlexBubbleStyle = {
828 header?: FlexBlockStyle;
829 hero?: FlexBlockStyle;
830 body?: FlexBlockStyle;
831 footer?: FlexBlockStyle;
832};
833export declare type FlexBlockStyle = {
834 /**
835 * Background color of the block. Use a hexadecimal color code.
836 */
837 backgroundColor?: string;
838 /**
839 * - `true` to place a separator above the block.
840 * - `true` will be ignored for the first block in a container because you
841 * cannot place a separator above the first block.
842 * - The default value is `false`.
843 */
844 separator?: boolean;
845 /**
846 * Color of the separator. Use a hexadecimal color code.
847 */
848 separatorColor?: string;
849};
850export declare type FlexCarousel = {
851 type: "carousel";
852 /**
853 * (Max: 12 bubbles)
854 */
855 contents: FlexBubble[];
856};
857/**
858 * Components are objects that compose a Flex Message container. Here are the
859 * types of components available:
860 *
861 * - [Box](https://developers.line.biz/en/reference/messaging-api/#box)
862 * - [Button](https://developers.line.biz/en/reference/messaging-api/#button)
863 * - [Image](https://developers.line.biz/en/reference/messaging-api/#f-image)
864 * - [Icon](https://developers.line.biz/en/reference/messaging-api/#icon)
865 * - [Text](https://developers.line.biz/en/reference/messaging-api/#f-text)
866 * - [Span](https://developers.line.biz/en/reference/messaging-api/#span)
867 * - [Separator](https://developers.line.biz/en/reference/messaging-api/#separator)
868 * - [Filler](https://developers.line.biz/en/reference/messaging-api/#filler)
869 * - [Spacer (not recommended)](https://developers.line.biz/en/reference/messaging-api/#spacer)
870 *
871 * See the followings for the components' JSON data samples and usage.
872 *
873 * - [Flex Message elements](https://developers.line.biz/en/docs/messaging-api/flex-message-elements/)
874 * - [Flex Message layout](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/)
875 */
876export declare type FlexComponent = FlexBox | FlexButton | FlexImage | FlexIcon | FlexText | FlexSpan | FlexSeparator | FlexFiller | FlexSpacer;
877/**
878 * This is a component that defines the layout of child components.
879 * You can also include a box in a box.
880 */
881export declare type FlexBox = {
882 type: "box";
883 /**
884 * The placement style of components in this box. Specify one of the following values:
885 *
886 * - `horizontal`: Components are placed horizontally. The `direction`
887 * property of the [bubble](https://developers.line.biz/en/reference/messaging-api/#bubble)
888 * container specifies the order.
889 * - `vertical`: Components are placed vertically from top to bottom.
890 * - `baseline`: Components are placed in the same way as `horizontal` is
891 * specified except the baselines of the components are aligned.
892 *
893 * For more information, see
894 * [Types of box layouts](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#box-layout-types).
895 */
896 layout: "horizontal" | "vertical" | "baseline";
897 /**
898 * Components in this box. Here are the types of components available:
899 *
900 * - When the `layout` property is `horizontal` or `vertical`:
901 * + [Box](https://developers.line.biz/en/reference/messaging-api/#box)
902 * + [button](https://developers.line.biz/en/reference/messaging-api/#button)
903 * + [image](https://developers.line.biz/en/reference/messaging-api/#f-image)
904 * + [text](https://developers.line.biz/en/reference/messaging-api/#f-text)
905 * + [separator](https://developers.line.biz/en/reference/messaging-api/#separator)
906 * + [filler](https://developers.line.biz/en/reference/messaging-api/#filler)
907 * + [spacer (not recommended)](https://developers.line.biz/en/reference/messaging-api/#spacer)
908 * - When the `layout` property is `baseline`:
909 * + [icon](https://developers.line.biz/en/reference/messaging-api/#icon)
910 * + [text](https://developers.line.biz/en/reference/messaging-api/#f-text)
911 * + [filler](https://developers.line.biz/en/reference/messaging-api/#filler)
912 * + [spacer (not recommended)](https://developers.line.biz/en/reference/messaging-api/#spacer)
913 */
914 contents: FlexComponent[];
915 /**
916 * Background color of the block. In addition to the RGB color, an alpha
917 * channel (transparency) can also be set. Use a hexadecimal color code.
918 * (Example:#RRGGBBAA) The default value is `#00000000`.
919 */
920 backgroundColor?: string;
921 /**
922 * Color of box border. Use a hexadecimal color code.
923 */
924 borderColor?: string;
925 /**
926 * Width of box border. You can specify a value in pixels or any one of none,
927 * light, normal, medium, semi-bold, or bold. none does not render a border
928 * while the others become wider in the order of listing.
929 */
930 borderWidth?: string | "none" | "light" | "normal" | "medium" | "semi-bold" | "bold";
931 /**
932 * Radius at the time of rounding the corners of the border. You can specify a
933 * value in pixels or any one of `none`, `xs`, `sm`, `md`, `lg`, `xl`, or `xxl`. none does not
934 * round the corner while the others increase in radius in the order of listing. The default value is none.
935 */
936 cornerRadius?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
937 /**
938 * 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.
939 */
940 width?: string;
941 /**
942 * 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.
943 */
944 height?: string;
945 /**
946 * The ratio of the width or height of this box within the parent box. The
947 * default value for the horizontal parent box is `1`, and the default value
948 * for the vertical parent box is `0`.
949 *
950 * For more information, see
951 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
952 */
953 flex?: number;
954 /**
955 * Minimum space between components in this box.
956 *
957 * - `none` does not set a space while the other values set a space whose
958 * size increases in the order of listing.
959 * - The default value is `none`.
960 * - To override this setting for a specific component, set the `margin`
961 * property of that component.
962 */
963 spacing?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
964 /**
965 * Minimum space between this box and the previous component in the parent box.
966 *
967 * - `none` does not set a space while the other values set a space whose
968 * size increases in the order of listing.
969 * - The default value is the value of the `spacing` property of the parent
970 * box.
971 * - If this box is the first component in the parent box, the `margin`
972 * property will be ignored.
973 */
974 margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
975 /**
976 * Free space between the borders of this box and the child element.
977 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
978 */
979 paddingAll?: string;
980 /**
981 * Free space between the border at the upper end of this box and the upper end of the child element.
982 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
983 */
984 paddingTop?: string;
985 /**
986 * Free space between the border at the lower end of this box and the lower end of the child element.
987 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
988 */
989 paddingBottom?: string;
990 /**
991 * Free space between the border at the left end of this box and the left end of the child element.
992 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
993 */
994 paddingStart?: string;
995 /**
996 * Free space between the border at the right end of this box and the right end of the child element.
997 * For more information, see [Box padding](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#padding-property) in the API documentation.
998 */
999 paddingEnd?: string;
1000 /**
1001 * Action performed when this button is tapped.
1002 *
1003 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1004 */
1005 action?: Action;
1006 /**
1007 * How child elements are aligned along the main axis of the parent element. If the
1008 * parent element is a horizontal box, this only takes effect when its child elements have
1009 * 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)
1010 * in the Messaging API documentation.
1011 */
1012 justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
1013 /**
1014 * How child elements are aligned along the cross axis of the parent element. For more
1015 * 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.
1016 */
1017 alignItems?: "flex-start" | "center" | "flex-end";
1018 background?: Background;
1019} & Offset;
1020export declare type Offset = {
1021 /**
1022 * Reference position for placing this box. Specify one of the following values:
1023 * - `relative`: Use the previous box as reference.
1024 * - `absolute`: Use the top left of parent element as reference.
1025 *
1026 * The default value is relative.
1027 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1028 */
1029 position?: "relative" | "absolute";
1030 /**
1031 * The top offset.
1032 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1033 */
1034 offsetTop?: string;
1035 /**
1036 * The bottom offset.
1037 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1038 */
1039 offsetBottom?: string;
1040 /**
1041 * The left offset.
1042 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1043 */
1044 offsetStart?: string;
1045 /**
1046 * The right offset.
1047 * For more information, see [Offset](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-offset) in the API documentation.
1048 */
1049 offsetEnd?: string;
1050};
1051export declare type Background = {
1052 /**
1053 * The type of background used. Specify these values:
1054 * - `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.
1055 */
1056 type: "linearGradient";
1057 /**
1058 * The angle at which a linear gradient moves. Specify the angle using an integer value
1059 * like `90deg` (90 degrees) or a decimal number like `23.5deg` (23.5 degrees) in the
1060 * half-open interval [0, 360). The direction of the linear gradient rotates clockwise as the
1061 * angle increases. Given a value of `0deg`, the gradient starts at the bottom and ends at
1062 * the top; given a value of `45deg`, the gradient starts at the bottom-left corner and ends
1063 * at the top-right corner; given a value of 90deg, the gradient starts at the left and ends
1064 * at the right; and given a value of `180deg`, the gradient starts at the top and ends at
1065 * 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.
1066 */
1067 angle: string;
1068 /**
1069 * The color at the gradient's starting point. Use a hexadecimal color code in the
1070 * `#RRGGBB` or `#RRGGBBAA` format.
1071 */
1072 startColor: string;
1073 /**
1074 * The color at the gradient's ending point. Use a hexadecimal color code in the
1075 * `#RRGGBB` or `#RRGGBBAA` format.
1076 */
1077 endColor: string;
1078 /**
1079 * The color in the middle of the gradient. Use a hexadecimal color code in the `#RRGGBB`
1080 * or `#RRGGBBAA` format. Specify a value for the `background.centerColor` property to
1081 * 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
1082 * Messaging API documentation.
1083 */
1084 centerColor?: string;
1085 /**
1086 * The position of the intermediate color stop. Specify an integer or decimal value
1087 * between `0%` (the starting point) and `100%` (the ending point). This is `50%` by
1088 * 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
1089 * Messaging API documentation.
1090 */
1091 centerPosition?: string;
1092};
1093/**
1094 * This component draws a button.
1095 *
1096 * When the user taps a button, a specified action is performed.
1097 */
1098export declare type FlexButton = {
1099 type: "button";
1100 /**
1101 * Action performed when this button is tapped.
1102 *
1103 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1104 */
1105 action: Action;
1106 /**
1107 * The ratio of the width or height of this box within the parent box.
1108 *
1109 * The default value for the horizontal parent box is `1`, and the default
1110 * value for the vertical parent box is `0`.
1111 *
1112 * For more information, see
1113 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1114 */
1115 flex?: number;
1116 /**
1117 * Minimum space between this box and the previous component in the parent box.
1118 *
1119 * - `none` does not set a space while the other values set a space whose
1120 * size increases in the order of listing.
1121 * - The default value is the value of the `spacing` property of the parent
1122 * box.
1123 * - If this box is the first component in the parent box, the `margin`
1124 * property will be ignored.
1125 */
1126 margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1127 /**
1128 * Height of the button. The default value is `md`.
1129 */
1130 height?: "sm" | "md";
1131 /**
1132 * Style of the button. Specify one of the following values:
1133 *
1134 * - `link`: HTML link style
1135 * - `primary`: Style for dark color buttons
1136 * - `secondary`: Style for light color buttons
1137 *
1138 * The default value is `link`.
1139 */
1140 style?: "link" | "primary" | "secondary";
1141 /**
1142 * Use a hexadecimal color code.
1143 *
1144 * - Character color when the `style` property is `link`.
1145 * - Background color when the `style` property is `primary` or `secondary`.
1146 */
1147 color?: string;
1148 /**
1149 * Vertical alignment style. Specify one of the following values:
1150 *
1151 * - `top`: Top-aligned
1152 * - `bottom`: Bottom-aligned
1153 * - `center`: Center-aligned
1154 *
1155 * The default value is `top`.
1156 *
1157 * If the `layout` property of the parent box is `baseline`, the `gravity`
1158 * property will be ignored.
1159 */
1160 gravity?: "top" | "bottom" | "center";
1161 /**
1162 * The method by which to adjust the text font size. Specify this value:
1163 *
1164 * - `shrink-to-fit`: Automatically shrink the font
1165 * size to fit the width of the component. This
1166 * property takes a "best-effort" approach that may
1167 * work differently—or not at all!—on some platforms.
1168 * For more information, see [Automatically shrink fonts to fit](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#adjusts-fontsize-to-fit)
1169 * in the Messaging API documentation.
1170 * - LINE 10.13.0 or later for iOS and Android
1171 */
1172 adjustMode?: "shrink-to-fit";
1173} & Offset;
1174/**
1175 * This is an invisible component to fill extra space between components.
1176 *
1177 * - The filler's `flex` property is fixed to 1.
1178 * - The `spacing` property of the parent box will be ignored for fillers.
1179 */
1180export declare type FlexFiller = {
1181 type: "filler";
1182 /**
1183 * 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).
1184 */
1185 flex?: number;
1186};
1187/**
1188 * This component draws an icon.
1189 */
1190export declare type FlexIcon = {
1191 type: "icon";
1192 /**
1193 * Image URL (Max character limit: 2000)
1194 *
1195 * Protocol: HTTPS
1196 * Image format: JPEG or PNG
1197 * Maximum image size: 240×240 pixels
1198 * Maximum data size: 1 MB
1199 */
1200 url: string;
1201 /**
1202 * Minimum space between this box and the previous component in the parent
1203 * box.
1204 *
1205 * - `none` does not set a space while the other values set a space whose
1206 * size increases in the order of listing.
1207 * - The default value is the value of the `spacing` property of the parent
1208 * box.
1209 * - If this box is the first component in the parent box, the `margin`
1210 * property will be ignored.
1211 */
1212 margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1213 /**
1214 * Maximum size of the icon width.
1215 * The size increases in the order of listing.
1216 * The default value is `md`.
1217 * 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.
1218 */
1219 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl";
1220 /**
1221 * Aspect ratio of the icon. `{width}:{height}` format.
1222 * The values of `{width}` and `{height}` must be in the range 1–100000.
1223 * `{height}` can't be more than three times the value of `{width}`.
1224 * The default value is `1:1`.
1225 */
1226 aspectRatio?: string;
1227} & Offset;
1228/**
1229 * This component draws an image.
1230 */
1231export declare type FlexImage = {
1232 type: "image";
1233 /**
1234 * Image URL (Max character limit: 2000)
1235 *
1236 * - Protocol: HTTPS
1237 * - Image format: JPEG or PNG
1238 * - Maximum image size: 1024×1024 pixels
1239 * - Maximum data size: 1 MB
1240 */
1241 url: string;
1242 /**
1243 * The ratio of the width or height of this box within the parent box.
1244 *
1245 * The default value for the horizontal parent box is `1`, and the default
1246 * value for the vertical parent box is `0`.
1247 *
1248 * - For more information, see
1249 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1250 */
1251 flex?: number;
1252 /**
1253 * Minimum space between this box and the previous component in the parent
1254 * box.
1255 *
1256 * - `none` does not set a space while the other values set a space whose
1257 * size increases in the order of listing.
1258 * - The default value is the value of the `spacing` property of the parent
1259 * box.
1260 * - If this box is the first component in the parent box, the `margin`
1261 * property will be ignored.
1262 */
1263 margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1264 /**
1265 * Horizontal alignment style. Specify one of the following values:
1266 *
1267 * - `start`: Left-aligned
1268 * - `end`: Right-aligned
1269 * - `center`: Center-aligned
1270 *
1271 * The default value is `center`.
1272 */
1273 align?: "start" | "end" | "center";
1274 /**
1275 * Vertical alignment style. Specify one of the following values:
1276 *
1277 * - `top`: Top-aligned
1278 * - `bottom`: Bottom-aligned
1279 * - `center`: Center-aligned
1280 *
1281 * The default value is `top`.
1282 *
1283 * If the `layout` property of the parent box is `baseline`, the `gravity` property will be ignored.
1284 */
1285 gravity?: "top" | "bottom" | "center";
1286 /**
1287 * Maximum size of the image width.
1288 * The size increases in the order of listing.
1289 * The default value is `md`.
1290 * For more information, see [Image size](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#image-size) in the Messaging API documentation.
1291 */
1292 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl" | "full";
1293 /**
1294 * Aspect ratio of the image. `{width}:{height}` format.
1295 * Specify the value of `{width}` and `{height}` in the range from 1 to 100000. However,
1296 * you cannot set `{height}` to a value that is more than three times the value of `{width}`.
1297 * The default value is `1:1`.
1298 */
1299 aspectRatio?: string;
1300 /**
1301 * Style of the image. Specify one of the following values:
1302 *
1303 * - `cover`: The image fills the entire drawing area. Parts of the image
1304 * that do not fit in the drawing area are not displayed.
1305 * - `fit`: The entire image is displayed in the drawing area. The background
1306 * is displayed in the unused areas to the left and right of vertical images
1307 * and in the areas above and below horizontal images.
1308 *
1309 * The default value is `fit`.
1310 */
1311 aspectMode?: "cover" | "fit";
1312 /**
1313 * Background color of the image. Use a hexadecimal color code.
1314 */
1315 backgroundColor?: string;
1316 /**
1317 * Action performed when this button is tapped.
1318 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1319 */
1320 action?: Action;
1321 /**
1322 * When this is `true`, an animated image (APNG) plays.
1323 * You can specify a value of `true` up to three times in a single message.
1324 * You can't send messages that exceed this limit.
1325 * This is `false` by default.
1326 * Animated images larger than 300 KB aren't played back.
1327 */
1328 animated?: Boolean;
1329} & Offset;
1330/**
1331 * This component draws a separator between components in the parent box.
1332 */
1333export declare type FlexSeparator = {
1334 type: "separator";
1335 /**
1336 * Minimum space between this box and the previous component in the parent
1337 * box.
1338 *
1339 * - `none` does not set a space while the other values set a space whose
1340 * size increases in the order of listing.
1341 * - The default value is the value of the `spacing` property of the parent
1342 * box.
1343 * - If this box is the first component in the parent box, the `margin`
1344 * property will be ignored.
1345 */
1346 margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1347 /**
1348 * Color of the separator. Use a hexadecimal color code.
1349 */
1350 color?: string;
1351};
1352/**
1353 * This is an invisible component that places a fixed-size space at the
1354 * beginning or end of the box.
1355 * @deprecated
1356 */
1357export declare type FlexSpacer = {
1358 type: "spacer";
1359 /**
1360 * Size of the space.
1361 * The size increases in the order of listing.
1362 * The default value is `md`.
1363 */
1364 size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1365};
1366export declare type FlexText = {
1367 type: "text";
1368 text: string;
1369 /**
1370 * 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.
1371 */
1372 contents?: FlexSpan[];
1373 /**
1374 * The method by which to adjust the text font size. Specify this value:
1375 *
1376 * - `shrink-to-fit`: Automatically shrink the font
1377 * size to fit the width of the component. This
1378 * property takes a "best-effort" approach that may
1379 * work differently—or not at all!—on some platforms.
1380 * For more information, see [Automatically shrink fonts to fit](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#adjusts-fontsize-to-fit)
1381 * in the Messaging API documentation.
1382 * - LINE 10.13.0 or later for iOS and Android
1383 */
1384 adjustMode?: "shrink-to-fit";
1385 /**
1386 * The ratio of the width or height of this box within the parent box.
1387 *
1388 * The default value for the horizontal parent box is `1`, and the default
1389 * value for the vertical parent box is `0`.
1390 *
1391 * For more information, see
1392 * [Width and height of components](https://developers.line.biz/en/docs/messaging-api/flex-message-layout/#component-width-and-height).
1393 */
1394 flex?: number;
1395 /**
1396 * Minimum space between this box and the previous component in the parent
1397 * box.
1398 *
1399 * - `none` does not set a space while the other values set a space whose
1400 * size increases in the order of listing.
1401 * - The default value is the value of the `spacing` property of the parent
1402 * box.
1403 * - If this box is the first component in the parent box, the `margin`
1404 * property will be ignored.
1405 */
1406 margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
1407 /**
1408 * Font size.
1409 * The size increases in the order of listing.
1410 * The default value is `md`.
1411 * 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.
1412 */
1413 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl";
1414 /**
1415 * Horizontal alignment style. Specify one of the following values:
1416 *
1417 * - `start`: Left-aligned
1418 * - `end`: Right-aligned
1419 * - `center`: Center-aligned
1420 *
1421 * The default value is `start`.
1422 */
1423 align?: "start" | "end" | "center";
1424 /**
1425 * Vertical alignment style. Specify one of the following values:
1426 *
1427 * - `top`: Top-aligned
1428 * - `bottom`: Bottom-aligned
1429 * - `center`: Center-aligned
1430 *
1431 * The default value is `top`.
1432 *
1433 * If the `layout` property of the parent box is `baseline`, the `gravity`
1434 * property will be ignored.
1435 */
1436 gravity?: "top" | "bottom" | "center";
1437 /**
1438 * `true` to wrap text.
1439 *
1440 * The default value is `false`.
1441 *
1442 * If set to `true`, you can use a new line character (\n) to begin on a new
1443 * line.
1444 */
1445 wrap?: boolean;
1446 /**
1447 * Max number of lines. If the text does not fit in the specified number of
1448 * lines, an ellipsis (…) is displayed at the end of the last line. If set to
1449 * 0, all the text is displayed. The default value is 0.
1450 */
1451 maxLines?: number;
1452 /**
1453 * Font weight.
1454 * Specifying `bold`makes the font bold.
1455 * The default value is `regular`.
1456 */
1457 weight?: "regular" | "bold";
1458 /**
1459 * Font color. Use a hexadecimal color code.
1460 */
1461 color?: string;
1462 /**
1463 * Action performed when this text is tapped.
1464 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1465 */
1466 action?: Action;
1467 /**
1468 * Style of the text. Specify one of the following values:
1469 * - `normal`: Normal
1470 * - `italic`: Italic
1471 *
1472 * The default value is `normal`.
1473 */
1474 style?: string;
1475 /**
1476 * Decoration of the text. Specify one of the following values:
1477 * `none`: No decoration
1478 * `underline`: Underline
1479 * `line-through`: Strikethrough
1480 *
1481 * The default value is `none`.
1482 */
1483 decoration?: string;
1484} & Offset;
1485/**
1486 * 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).
1487 */
1488export declare type FlexSpan = {
1489 type: "span";
1490 /**
1491 * 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.
1492 */
1493 text: string;
1494 /**
1495 * Font color. Use a hexadecimal color code.
1496 */
1497 color?: string;
1498 /**
1499 * 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`.
1500 * 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.
1501 */
1502 size?: string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl";
1503 /**
1504 * Font weight. You can specify one of the following values: `regular` or `bold`. Specifying `bold` makes the font bold. The default value is `regular`.
1505 */
1506 weight?: string;
1507 /**
1508 * Style of the text. Specify one of the following values:
1509 * - `normal`: Normal
1510 * - `italic`: Italic
1511 *
1512 * The default value is `normal`.
1513 */
1514 style?: string;
1515 /**
1516 * Decoration of the text. Specify one of the following values:
1517 * `none`: No decoration
1518 * `underline`: Underline
1519 * `line-through`: Strikethrough
1520 *
1521 * The default value is `none`.
1522 *
1523 * 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.
1524 */
1525 decoration?: string;
1526};
1527export declare type TemplateContent = TemplateButtons | TemplateConfirm | TemplateCarousel | TemplateImageCarousel;
1528/**
1529 * Template with an image, title, text, and multiple action buttons.
1530 *
1531 * Because of the height limitation for buttons template messages, the lower
1532 * part of the text display area will get cut off if the height limitation is
1533 * exceeded. For this reason, depending on the character width, the message
1534 * text may not be fully displayed even when it is within the character limits.
1535 */
1536export declare type TemplateButtons = {
1537 type: "buttons";
1538 /**
1539 * Image URL (Max: 2000 characters)
1540 *
1541 * - HTTPS
1542 * - JPEG or PNG
1543 * - Max width: 1024px
1544 * - Max: 1 MB
1545 */
1546 thumbnailImageUrl?: string;
1547 /**
1548 * Aspect ratio of the image. Specify one of the following values:
1549 *
1550 * - `rectangle`: 1.51:1
1551 * - `square`: 1:1
1552 *
1553 * The default value is `rectangle`
1554 */
1555 imageAspectRatio?: "rectangle" | "square";
1556 /**
1557 * Size of the image. Specify one of the following values:
1558 *
1559 * - `cover`: The image fills the entire image area. Parts of the image that
1560 * do not fit in the area are not displayed.
1561 * - `contain`: The entire image is displayed in the image area. A background
1562 * is displayed in the unused areas to the left and right of vertical images
1563 * and in the areas above and below horizontal images.
1564 *
1565 * The default value is `cover`.
1566 */
1567 imageSize?: "cover" | "contain";
1568 /**
1569 * Background color of image. Specify a RGB color value.
1570 * The default value is `#FFFFFF` (white).
1571 */
1572 imageBackgroundColor?: string;
1573 /**
1574 * Title (Max: 40 characters)
1575 */
1576 title?: string;
1577 /**
1578 * Message text
1579 *
1580 * - Max: 160 characters (no image or title)
1581 * - Max: 60 characters (message with an image or title)
1582 */
1583 text: string;
1584 /**
1585 * Action when tapped (Max: 4)
1586 */
1587 actions: Action[];
1588};
1589/**
1590 * Template with two action buttons.
1591 *
1592 * Because of the height limitation for confirm template messages, the lower
1593 * part of the `text` display area will get cut off if the height limitation is
1594 * exceeded. For this reason, depending on the character width, the message
1595 * text may not be fully displayed even when it is within the character limits.
1596 */
1597export declare type TemplateConfirm = {
1598 type: "confirm";
1599 /**
1600 * Message text (Max: 240 characters)
1601 */
1602 text: string;
1603 /**
1604 * Action when tapped. Set 2 actions for the 2 buttons
1605 */
1606 actions: Action[];
1607};
1608/**
1609 * Template with multiple columns which can be cycled like a carousel.
1610 * The columns will be shown in order by scrolling horizontally.
1611 *
1612 * Because of the height limitation for carousel template messages, the lower
1613 * part of the `text` display area will get cut off if the height limitation is
1614 * exceeded. For this reason, depending on the character width, the message
1615 * text may not be fully displayed even when it is within the character limits.
1616 *
1617 * Keep the number of actions consistent for all columns. If you use an image
1618 * or title for a column, make sure to do the same for all other columns.
1619 */
1620export declare type TemplateCarousel = {
1621 type: "carousel";
1622 /**
1623 * Array of columns (Max: 10)
1624 */
1625 columns: TemplateColumn[];
1626 /**
1627 * Aspect ratio of the image. Specify one of the following values:
1628 *
1629 * - `rectangle`: 1.51:1
1630 * - `square`: 1:1
1631 *
1632 * Applies to all columns. The default value is `rectangle`.
1633 */
1634 imageAspectRatio?: "rectangle" | "square";
1635 /**
1636 * Size of the image. Specify one of the following values:
1637 *
1638 * - `cover`: The image fills the entire image area. Parts of the image that
1639 * do not fit in the area are not displayed.
1640 * - `contain`: The entire image is displayed in the image area. A background
1641 * is displayed in the unused areas to the left and right of vertical images
1642 * and in the areas above and below horizontal images.
1643 *
1644 * Applies to all columns. The default value is `cover`.
1645 */
1646 imageSize?: "cover" | "contain";
1647};
1648export declare type TemplateColumn = {
1649 /**
1650 * Image URL (Max: 2000 characters)
1651 *
1652 * - HTTPS
1653 * - JPEG or PNG
1654 * - Aspect ratio: 1:1.51
1655 * - Max width: 1024px
1656 * - Max: 1 MB
1657 */
1658 thumbnailImageUrl?: string;
1659 /**
1660 * Background color of image. Specify a RGB color value.
1661 * The default value is `#FFFFFF` (white).
1662 */
1663 imageBackgroundColor?: string;
1664 /**
1665 * Title (Max: 40 characters)
1666 */
1667 title?: string;
1668 /**
1669 * Message text
1670 *
1671 * - Max: 120 characters (no image or title)
1672 * - Max: 60 characters (message with an image or title)
1673 */
1674 text: string;
1675 /**
1676 * Action when image is tapped; set for the entire image, title, and text area
1677 */
1678 defaultAction?: Action;
1679 /**
1680 * Action when tapped (Max: 3)
1681 */
1682 actions: Action[];
1683};
1684/**
1685 * Template with multiple images which can be cycled like a carousel.
1686 * The images will be shown in order by scrolling horizontally.
1687 */
1688export declare type TemplateImageCarousel = {
1689 type: "image_carousel";
1690 /**
1691 * Array of columns (Max: 10)
1692 */
1693 columns: TemplateImageColumn[];
1694};
1695export declare type TemplateImageColumn = {
1696 /**
1697 * Image URL (Max: 2000 characters)
1698 *
1699 * - HTTPS
1700 * - JPEG or PNG
1701 * - Aspect ratio: 1:1
1702 * - Max width: 1024px
1703 * - Max: 1 MB
1704 */
1705 imageUrl: string;
1706 /**
1707 * Action when image is tapped
1708 */
1709 action: Action<{
1710 label?: string;
1711 }>;
1712};
1713/**
1714 * These properties are used for the quick reply.
1715 *
1716 * For more information, see
1717 * [Using quick replies](https://developers.line.biz/en/docs/messaging-api/using-quick-reply/).
1718 */
1719export declare type QuickReply = {
1720 /**
1721 * This is a container that contains
1722 * [quick reply buttons](https://developers.line.biz/en/reference/messaging-api/#quick-reply-button-object).
1723 *
1724 * Array of objects (Max: 13)
1725 */
1726 items: QuickReplyItem[];
1727};
1728/**
1729 * This is a quick reply option that is displayed as a button.
1730 *
1731 * For more information, see
1732 * [quick reply buttons](https://developers.line.biz/en/reference/messaging-api/#quick-reply-button-object).
1733 */
1734export declare type QuickReplyItem = {
1735 type: "action";
1736 /**
1737 * URL of the icon that is displayed at the beginning of the button (Max: 1000 characters)
1738 *
1739 * - URL scheme: https
1740 * - Image format: PNG
1741 * - Aspect ratio: 1:1
1742 * - Data size: Up to 1 MB
1743 *
1744 * There is no limit on the image size. If the `action` property has the
1745 * following actions with empty `imageUrl`:
1746 *
1747 * - [camera action](https://developers.line.biz/en/reference/messaging-api/#camera-action)
1748 * - [camera roll action](https://developers.line.biz/en/reference/messaging-api/#camera-roll-action)
1749 * - [location action](https://developers.line.biz/en/reference/messaging-api/#location-action)
1750 *
1751 * the default icon is displayed.
1752 */
1753 imageUrl?: string;
1754 /**
1755 * Action performed when this button is tapped.
1756 *
1757 * Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1758 *
1759 * The following is a list of the available actions:
1760 *
1761 * - [Postback action](https://developers.line.biz/en/reference/messaging-api/#postback-action)
1762 * - [Message action](https://developers.line.biz/en/reference/messaging-api/#message-action)
1763 * - [Datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action)
1764 * - [Camera action](https://developers.line.biz/en/reference/messaging-api/#camera-action)
1765 * - [Camera roll action](https://developers.line.biz/en/reference/messaging-api/#camera-roll-action)
1766 * - [Location action](https://developers.line.biz/en/reference/messaging-api/#location-action)
1767 * - [URI action](https://developers.line.biz/en/reference/messaging-api/#uri-action)
1768 */
1769 action: Action;
1770};
1771export declare type Sender = {
1772 /**
1773 * Display name
1774 *
1775 * - Max character limit: 20
1776 * - Certain words such as `LINE` may not be used.
1777 */
1778 name?: string;
1779 /**
1780 * Icon image URL
1781 *
1782 * - Max character limit: 1000
1783 * - URL scheme: https
1784 */
1785 iconUrl?: string;
1786};
1787/**
1788 * These are types of actions for your bot to take when a user taps a button or an image in a message.
1789 *
1790 * - [Postback action](https://developers.line.biz/en/reference/messaging-api/#postback-action)
1791 * - [Message action](https://developers.line.biz/en/reference/messaging-api/#message-action)
1792 * - [URI action](https://developers.line.biz/en/reference/messaging-api/#uri-action)
1793 * - [Datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action)
1794 * - [Rich menu switch action](https://developers.line.biz/en/reference/messaging-api/#richmenu-switch-action)
1795 * - [Camera action](https://developers.line.biz/en/reference/messaging-api/#camera-action)
1796 * - [Camera roll action](https://developers.line.biz/en/reference/messaging-api/#camera-roll-action)
1797 * - [Location action](https://developers.line.biz/en/reference/messaging-api/#location-action)
1798 */
1799export declare type Action<ExtraFields = {
1800 label: string;
1801}> = (PostbackAction | MessageAction | URIAction | DatetimePickerAction | RichMenuSwitchAction | {
1802 type: "camera";
1803} | {
1804 type: "cameraRoll";
1805} | {
1806 type: "location";
1807}) & ExtraFields;
1808/**
1809 * When a control associated with this action is tapped, a postback event is
1810 * returned via webhook with the specified string in the data property.
1811 */
1812export declare type PostbackAction = {
1813 type: "postback";
1814 /**
1815 * String returned via webhook in the `postback.data` property of the
1816 * postback event (Max: 300 characters)
1817 */
1818 data: string;
1819 /**
1820 * Text displayed in the chat as a message sent by the user when the action
1821 * is performed. Returned from the server through a webhook.
1822 *
1823 * - This property cannot be used with quick reply buttons. (Max: 300 characters)
1824 * - The `displayText` and `text` properties cannot both be used at the same time.
1825 * @deprecated
1826 */
1827 text?: string;
1828 /**
1829 * Text displayed in the chat as a message sent by the user when the action is performed.
1830 *
1831 * - Required for quick reply buttons.
1832 * - Optional for the other message types.
1833 *
1834 * Max: 300 characters
1835 *
1836 * The `displayText` and `text` properties cannot both be used at the same time.
1837 */
1838 displayText?: string;
1839};
1840/**
1841 * When a control associated with this action is tapped, the string in the text
1842 * property is sent as a message from the user.
1843 */
1844export declare type MessageAction = {
1845 type: "message";
1846 /**
1847 * Text sent when the action is performed (Max: 300 characters)
1848 */
1849 text: string;
1850};
1851/**
1852 * When a control associated with this action is tapped, the URI specified in
1853 * the `uri` property is opened.
1854 */
1855export declare type URIAction = {
1856 type: "uri";
1857 /**
1858 * URI opened when the action is performed (Max: 1000 characters).
1859 * Must start with `http`, `https`, or `tel`.
1860 */
1861 uri: string;
1862 altUri?: AltURI;
1863};
1864/**
1865 * URI opened on LINE for macOS and Windows when the action is performed (Max: 1000 characters)
1866 * If the altUri.desktop property is set, the uri property is ignored on LINE for macOS and Windows.
1867 * The available schemes are http, https, line, and tel.
1868 * For more information about the LINE URL scheme, see Using the LINE URL scheme.
1869 * This property is supported on the following version of LINE.
1870 *
1871 * LINE 5.12.0 or later for macOS and Windows
1872 * Note: The altUri.desktop property is supported only when you set URI actions in Flex Messages.
1873 */
1874export declare type AltURI = {
1875 desktop: string;
1876};
1877/**
1878 * When a control associated with this action is tapped, a
1879 * [postback event](https://developers.line.biz/en/reference/messaging-api/#postback-event)
1880 * is returned via webhook with the date and time selected by the user from the
1881 * date and time selection dialog.
1882 *
1883 * The datetime picker action does not support time zones.
1884 *
1885 * #### Date and time format
1886 *
1887 * The date and time formats for the `initial`, `max`, and `min` values are
1888 * shown below. The `full-date`, `time-hour`, and `time-minute` formats follow
1889 * the [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) protocol.
1890 *
1891 * | Mode | Format | Example |
1892 * | -------- | ------------------------------------------------------------ | -------------------------------- |
1893 * | date | `full-date` (Max: 2100-12-31; Min: 1900-01-01) | 2017-06-18 |
1894 * | time | `time-hour`:`time-minute` (Max: 23:59; Min: 00:00) | 00:0006:1523:59 |
1895 * | 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 |
1896 */
1897export declare type DatetimePickerAction = {
1898 type: "datetimepicker";
1899 /**
1900 * String returned via webhook in the `postback.data` property of the
1901 * postback event (Max: 300 characters)
1902 */
1903 data: string;
1904 mode: "date" | "time" | "datetime";
1905 /**
1906 * Initial value of date or time
1907 */
1908 initial?: string;
1909 /**
1910 * Largest date or time value that can be selected. Must be greater than the
1911 * `min` value.
1912 */
1913 max?: string;
1914 /**
1915 * Smallest date or time value that can be selected. Must be less than the
1916 * `max` value.
1917 */
1918 min?: string;
1919};
1920export declare type Size = {
1921 width: number;
1922 height: number;
1923};
1924/**
1925 * When a control associated with this action is tapped, the URI specified in
1926 * the `uri` property is opened.
1927 */
1928export declare type RichMenuSwitchAction = {
1929 type: "richmenuswitch";
1930 /**
1931 * Action label. Optional for rich menus. Read when the user's device accessibility feature is enabled.
1932 * Max character limit: 20. Supported on LINE for iOS 8.2.0 or later.
1933 */
1934 label?: string;
1935 /**
1936 * Rich menu alias ID to switch to.
1937 */
1938 richMenuAliasId: string;
1939 /**
1940 * String returned by the postback.data property of the postback event via a webhook
1941 * Max character limit: 300
1942 */
1943 data: string;
1944};
1945/**
1946 * Rich menus consist of either of these objects.
1947 *
1948 * - [Rich menu object](https://developers.line.biz/en/reference/messaging-api/#rich-menu-object)
1949 * without the rich menu ID. Use this object when you
1950 * [create a rich menu](https://developers.line.biz/en/reference/messaging-api/#create-rich-menu).
1951 * - [Rich menu response object](https://developers.line.biz/en/reference/messaging-api/#rich-menu-response-object)
1952 * with the rich menu ID. This object is returned when you
1953 * [get a rich menu](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu)
1954 * or [get a list of rich menus](https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list).
1955 *
1956 * [Area objects](https://developers.line.biz/en/reference/messaging-api/#area-object) and
1957 * [action objects](https://developers.line.biz/en/reference/messaging-api/#action-objects)
1958 * are included in these objects.
1959 */
1960export declare type RichMenu = {
1961 /**
1962 * [`size` object](https://developers.line.biz/en/reference/messaging-api/#size-object)
1963 * which contains the width and height of the rich menu displayed in the chat.
1964 * Rich menu images must be one of the following sizes: 2500x1686px or 2500x843px.
1965 */
1966 size: Size;
1967 /**
1968 * `true` to display the rich menu by default. Otherwise, `false`.
1969 */
1970 selected: boolean;
1971 /**
1972 * Name of the rich menu.
1973 *
1974 * This value can be used to help manage your rich menus and is not displayed
1975 * to users.
1976 *
1977 * (Max: 300 characters)
1978 */
1979 name: string;
1980 /**
1981 * Text displayed in the chat bar (Max: 14 characters)
1982 */
1983 chatBarText: string;
1984 /**
1985 * Array of [area objects](https://developers.line.biz/en/reference/messaging-api/#area-object)
1986 * which define the coordinates and size of tappable areas
1987 * (Max: 20 area objects)
1988 */
1989 areas: Array<{
1990 bounds: Area;
1991 action: Action<{
1992 label?: string;
1993 }>;
1994 }>;
1995};
1996export declare type RichMenuResponse = {
1997 richMenuId: string;
1998} & RichMenu;
1999export declare type NumberOfMessagesSentResponse = InsightStatisticsResponse & {
2000 /**
2001 * The number of messages sent with the Messaging API on the date specified in date.
2002 * The response has this property only when the value of status is `ready`.
2003 */
2004 success?: number;
2005};
2006export declare type TargetLimitForAdditionalMessages = {
2007 /**
2008 * One of the following values to indicate whether a target limit is set or not.
2009 * - `none`: This indicates that a target limit is not set.
2010 * - `limited`: This indicates that a target limit is set.
2011 */
2012 type: "none" | "limited";
2013 /**
2014 * The target limit for additional messages in the current month.
2015 * This property is returned when the `type` property has a value of `limited`.
2016 */
2017 value?: number;
2018};
2019export declare type NumberOfMessagesSentThisMonth = {
2020 /**
2021 * The number of sent messages in the current month
2022 */
2023 totalUsage: number;
2024};
2025export declare const LINE_REQUEST_ID_HTTP_HEADER_NAME = "x-line-request-id";
2026export declare type MessageAPIResponseBase = {
2027 [LINE_REQUEST_ID_HTTP_HEADER_NAME]?: string;
2028};
2029export declare const LINE_SIGNATURE_HTTP_HEADER_NAME = "x-line-signature";
2030export declare type InsightStatisticsResponse = {
2031 /**
2032 * Calculation status. One of:
2033 * - `ready`: Calculation has finished; the numbers are up-to-date.
2034 * - `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.
2035 * - `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/).
2036 */
2037 status: "ready" | "unready" | "out_of_service";
2038};
2039export declare type NumberOfMessageDeliveries = InsightStatisticsResponse & {
2040 /**
2041 * Number of push messages sent to **all** of this LINE official account's friends (broadcast messages).
2042 */
2043 broadcast: number;
2044 /**
2045 * Number of push messages sent to **some** of this LINE official account's friends, based on specific attributes (targeted/segmented messages).
2046 */
2047 targeting: number;
2048 /**
2049 * Number of auto-response messages sent.
2050 */
2051 autoResponse: number;
2052 /**
2053 * Number of greeting messages sent.
2054 */
2055 welcomeResponse: number;
2056 /**
2057 * Number of messages sent from LINE Official Account Manager [Chat screen](https://www.linebiz.com/jp-en/manual/OfficialAccountManager/chats/screens/).
2058 */
2059 chat: number;
2060 /**
2061 * Number of broadcast messages sent with the [Send broadcast message](https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message) Messaging API operation.
2062 */
2063 apiBroadcast: number;
2064 /**
2065 * Number of push messages sent with the [Send push message](https://developers.line.biz/en/reference/messaging-api/#send-push-message) Messaging API operation.
2066 */
2067 apiPush: number;
2068 /**
2069 * Number of multicast messages sent with the [Send multicast message](https://developers.line.biz/en/reference/messaging-api/#send-multicast-message) Messaging API operation.
2070 */
2071 apiMulticast: number;
2072 /**
2073 * Number of replies sent with the [Send reply message](https://developers.line.biz/en/reference/messaging-api/#send-reply-message) Messaging API operation.
2074 */
2075 apiReply: number;
2076};
2077export declare type NumberOfFollowers = InsightStatisticsResponse & {
2078 /**
2079 * 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.
2080 */
2081 followers: Number;
2082 /**
2083 * 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.
2084 */
2085 targetedReaches: Number;
2086 /**
2087 * The number of users blocking the account as of the specified `date`. The number decreases when a user unblocks the account.
2088 */
2089 blocks: Number;
2090};
2091export declare type NumberOfMessageDeliveriesResponse = InsightStatisticsResponse | NumberOfMessageDeliveries;
2092export declare type NumberOfFollowersResponse = InsightStatisticsResponse | NumberOfFollowers;
2093declare type PercentageAble = {
2094 percentage: number;
2095};
2096export declare type FriendDemographics = {
2097 /**
2098 * `true` if friend demographic information is available.
2099 */
2100 available: boolean;
2101 /**
2102 * Percentage per gender
2103 */
2104 genders?: Array<{
2105 /**
2106 * Gender
2107 */
2108 gender: "unknown" | "male" | "female";
2109 } & PercentageAble>;
2110 /**
2111 * Percentage per age group
2112 */
2113 ages?: Array<{
2114 /**
2115 * Age group
2116 */
2117 age: string;
2118 } & PercentageAble>;
2119 /**
2120 * Percentage per area
2121 */
2122 areas?: Array<{
2123 area: string;
2124 } & PercentageAble>;
2125 /**
2126 * Percentage by OS
2127 */
2128 appTypes?: Array<{
2129 appType: "ios" | "android" | "others";
2130 } & PercentageAble>;
2131 /**
2132 * Percentage per friendship duration
2133 */
2134 subscriptionPeriods?: Array<{
2135 /**
2136 * Friendship duration
2137 */
2138 subscriptionPeriod: "over365days" | "within365days" | "within180days" | "within90days" | "within30days" | "within7days" | "unknown";
2139 } & PercentageAble>;
2140};
2141declare type UserInteractionStatisticsOfEachMessage = {
2142 seq: number;
2143 impression: number;
2144 mediaPlayed: number;
2145 mediaPlayed25Percent: number;
2146 mediaPlayed50Percent: number;
2147 mediaPlayed75Percent: number;
2148 mediaPlayed100Percent: number;
2149 uniqueMediaPlayed: number;
2150 uniqueMediaPlayed25Percent: number;
2151 uniqueMediaPlayed50Percent: number;
2152 uniqueMediaPlayed75Percent: number;
2153 uniqueMediaPlayed100Percent: number;
2154};
2155declare type UserInteractionStatisticsOfEachURL = {
2156 seq: number;
2157 url: number;
2158 click: number;
2159 uniqueClick: number;
2160 uniqueClickOfRequest: number;
2161};
2162/**
2163 * https://developers.line.biz/en/reference/messaging-api/#get-message-event
2164 */
2165export declare type UserInteractionStatistics = {
2166 overview: {
2167 requestId: string;
2168 timestamp: number;
2169 delivered: number;
2170 uniqueImpression: number;
2171 uniqueClick: number;
2172 uniqueMediaPlayed: number;
2173 uniqueMediaPlayed100Percent: number;
2174 };
2175 messages: UserInteractionStatisticsOfEachMessage[];
2176 clicks: UserInteractionStatisticsOfEachURL[];
2177};
2178declare type FilterOperatorObject<T> = {
2179 type: "operator";
2180} & ({
2181 and: (T | FilterOperatorObject<T>)[];
2182} | {
2183 or: (T | FilterOperatorObject<T>)[];
2184} | {
2185 not: T | (T | FilterOperatorObject<T>)[];
2186});
2187declare type AudienceObject = {
2188 type: "audience";
2189 audienceGroupId: number;
2190};
2191declare type RedeliveryObject = {
2192 type: "redelivery";
2193 requestId: string;
2194};
2195export declare type ReceieptObject = AudienceObject | RedeliveryObject | FilterOperatorObject<AudienceObject> | FilterOperatorObject<RedeliveryObject>;
2196declare type DemographicAge = "age_15" | "age_20" | "age_25" | "age_30" | "age_35" | "age_40" | "age_45" | "age_50";
2197declare type DemographicSubscriptionPeriod = "day_7" | "day_30" | "day_90" | "day_180" | "day_365";
2198declare 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";
2199declare type DemographicObject = {
2200 type: "gender";
2201 oneOf: ("male" | "female")[];
2202} | {
2203 type: "age";
2204 gte?: DemographicAge;
2205 lt?: DemographicAge;
2206} | {
2207 type: "appType";
2208 oneOf: ("ios" | "android")[];
2209} | {
2210 type: "area";
2211 oneOf: DemographicArea[];
2212} | {
2213 type: "subscriptionPeriod";
2214 gte?: DemographicSubscriptionPeriod;
2215 lt?: DemographicSubscriptionPeriod;
2216};
2217export declare type DemographicFilterObject = DemographicObject | FilterOperatorObject<DemographicObject>;
2218export declare type NarrowcastProgressResponse = ({
2219 phase: "waiting";
2220} | (({
2221 phase: "sending" | "succeeded";
2222} | {
2223 phase: "failed";
2224 failedDescription: string;
2225}) & {
2226 successCount: number;
2227 failureCount: number;
2228 targetCount: string;
2229 acceptedTime: string;
2230 completedTime: string;
2231})) & {
2232 errorCode?: 1 | 2;
2233};
2234declare type AudienceGroupJob = {
2235 audienceGroupJobId: number;
2236 audienceGroupId: number;
2237 description: string;
2238 type: "DIFF_ADD";
2239 audienceCount: number;
2240 created: number;
2241} & ({
2242 jobStatus: "QUEUED" | "WORKING" | "FINISHED";
2243} | {
2244 jobStatus: "FAILED";
2245 failedType: "INTERNAL_ERROR";
2246});
2247export declare type AudienceGroupStatus = "IN_PROGRESS" | "READY" | "EXPIRED" | "FAILED";
2248export declare type AudienceGroupCreateRoute = "OA_MANAGER" | "MESSAGING_API";
2249declare type _AudienceGroup = {
2250 audienceGroupId: number;
2251 description: string;
2252 audienceCount: number;
2253 created: number;
2254 isIfaAudience: boolean;
2255 permission: "READ" | "READ_WRITE";
2256 createRoute: AudienceGroupCreateRoute;
2257} & ({
2258 status: Exclude<AudienceGroupStatus, "FAILED">;
2259} | {
2260 status: "FAILED";
2261 failedType: "AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT" | "INTERNAL_ERROR";
2262}) & ({
2263 type: "UPLOAD";
2264} | {
2265 type: "CLICK";
2266 clickUrl: string;
2267} | {
2268 type: "IMP";
2269 requestId: string;
2270});
2271export declare type AudienceGroup = _AudienceGroup & {
2272 jobs: AudienceGroupJob[];
2273};
2274export declare type AudienceGroups = _AudienceGroup[];
2275export declare type AudienceGroupAuthorityLevel = "PUBLIC" | "PRIVATE";
2276export declare type ChannelAccessToken = {
2277 access_token: string;
2278 expires_in: number;
2279 token_type: "Bearer";
2280 key_id?: string;
2281};
2282/**
2283 * Response body of get group summary.
2284 *
2285 * @see [Get group summary](https://developers.line.biz/ja/reference/messaging-api/#get-group-summary)
2286 */
2287export declare type GroupSummaryResponse = {
2288 groupId: string;
2289 groupName: string;
2290 pictureUrl: string;
2291};
2292/**
2293 * Response body of get members in group count and get members in room count.
2294 *
2295 * @see [Get members in group count](https://developers.line.biz/en/reference/messaging-api/#get-members-group-count)
2296 * @see [Get members in room count](https://developers.line.biz/en/reference/messaging-api/#get-members-room-count)
2297 */
2298export declare type MembersCountResponse = {
2299 count: number;
2300};
2301export declare type GetRichMenuAliasResponse = {
2302 richMenuAliasId: string;
2303 richMenuId: string;
2304};
2305export declare type GetRichMenuAliasListResponse = {
2306 aliases: GetRichMenuAliasResponse[];
2307};
2308/**
2309 * Response body of get bot info.
2310 *
2311 * @see [Get bot info](https://developers.line.biz/en/reference/messaging-api/#get-bot-info)
2312 */
2313export declare type BotInfoResponse = {
2314 userId: string;
2315 basicId: string;
2316 premiumId?: string;
2317 displayName: string;
2318 pictureUrl?: string;
2319 chatMode: "chat" | "bot";
2320 markAsReadMode: "auto" | "manual";
2321};
2322/**
2323 * Response body of get webhook endpoint info.
2324 *
2325 * @see [Get get webhook endpoint info](https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information)
2326 */
2327export declare type WebhookEndpointInfoResponse = {
2328 endpoint: string;
2329 active: boolean;
2330};
2331/**
2332 * Response body of test webhook endpoint.
2333 *
2334 * @see [Test webhook endpoint](https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint)
2335 */
2336export declare type TestWebhookEndpointResponse = {
2337 success: boolean;
2338 timestamp: string;
2339 statusCode: number;
2340 reason: string;
2341 detail: string;
2342};
2343export {};