Skip to content

Commit 5bf1d4e

Browse files
authored
Flex message update 3 (#329)
* Add Video component * Add max width and height of a box component * Add line spacing in a text component
1 parent 57337b2 commit 5bf1d4e

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

lib/types.ts

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ export type FlexBubble = {
931931
*/
932932
direction?: "ltr" | "rtl";
933933
header?: FlexBox;
934-
hero?: FlexBox | FlexImage;
934+
hero?: FlexBox | FlexImage | FlexVideo;
935935
body?: FlexBox;
936936
footer?: FlexBox;
937937
styles?: FlexBubbleStyle;
@@ -978,6 +978,7 @@ export type FlexCarousel = {
978978
* - [Box](https://developers.line.biz/en/reference/messaging-api/#box)
979979
* - [Button](https://developers.line.biz/en/reference/messaging-api/#button)
980980
* - [Image](https://developers.line.biz/en/reference/messaging-api/#f-image)
981+
* - [Video](https://developers.line.biz/en/reference/messaging-api/#f-video)
981982
* - [Icon](https://developers.line.biz/en/reference/messaging-api/#icon)
982983
* - [Text](https://developers.line.biz/en/reference/messaging-api/#f-text)
983984
* - [Span](https://developers.line.biz/en/reference/messaging-api/#span)
@@ -994,6 +995,7 @@ export type FlexComponent =
994995
| FlexBox
995996
| FlexButton
996997
| FlexImage
998+
| FlexVideo
997999
| FlexIcon
9981000
| FlexText
9991001
| FlexSpan
@@ -1072,10 +1074,18 @@ export type FlexBox = {
10721074
* 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.
10731075
*/
10741076
width?: string;
1077+
/**
1078+
* 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.
1079+
*/
1080+
maxWidth?: string;
10751081
/**
10761082
* 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.
10771083
*/
10781084
height?: string;
1085+
/**
1086+
* 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.
1087+
*/
1088+
maxHeight?: string;
10791089
/**
10801090
* The ratio of the width or height of this box within the parent box. The
10811091
* default value for the horizontal parent box is `1`, and the default value
@@ -1497,6 +1507,53 @@ export type FlexImage = {
14971507
animated?: Boolean;
14981508
} & Offset;
14991509

1510+
/**
1511+
* This component draws a video.
1512+
*/
1513+
export type FlexVideo = {
1514+
type: "video";
1515+
/**
1516+
* Video file URL (Max character limit: 2000)
1517+
*
1518+
* - Protocol: HTTPS (TLS 1.2 or later)
1519+
* - Video format: mp4
1520+
* - Maximum data size: 200 MB
1521+
*/
1522+
url: string;
1523+
/**
1524+
* Preview image URL (Max character limit: 2000)
1525+
*
1526+
* - Protocol: HTTPS (TLS 1.2 or later)
1527+
* - Image format: JPEG or PNG
1528+
* - Maximum data size: 1 MB
1529+
*/
1530+
previewUrl: string;
1531+
/**
1532+
* Alternative content.
1533+
*
1534+
* The alternative content will be displayed on the screen of a user device
1535+
* that is using a version of LINE that doesn't support the video component.
1536+
* Specify a box or an image.
1537+
*
1538+
* - Protocol: HTTPS (TLS 1.2 or later)
1539+
* - Image format: JPEG or PNG
1540+
* - Maximum data size: 1 MB
1541+
*/
1542+
altContent: FlexBox | FlexImage;
1543+
/**
1544+
* Aspect ratio of the video. `{width}:{height}` format.
1545+
* Specify the value of `{width}` and `{height}` in the range from 1 to 100000. However,
1546+
* you cannot set `{height}` to a value that is more than three times the value of `{width}`.
1547+
* The default value is `1:1`.
1548+
*/
1549+
aspectRatio?: string;
1550+
/**
1551+
* Action performed when this button is tapped.
1552+
* Specify an [action object](https://developers.line.biz/en/reference/messaging-api/#action-objects).
1553+
*/
1554+
action?: Action;
1555+
};
1556+
15001557
/**
15011558
* This component draws a separator between components in the parent box.
15021559
*/
@@ -1620,6 +1677,14 @@ type FlexTextBase = {
16201677
* line.
16211678
*/
16221679
wrap?: boolean;
1680+
/**
1681+
* Line spacing in a wrapping text.
1682+
*
1683+
* Specify a positive integer or decimal number that ends in px.
1684+
* The `lineSpacing` property doesn't apply to the top of the start line and the bottom of the last line.
1685+
* 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.
1686+
*/
1687+
lineSpacing?: string;
16231688
/**
16241689
* Max number of lines. If the text does not fit in the specified number of
16251690
* lines, an ellipsis (…) is displayed at the end of the last line. If set to

0 commit comments

Comments
 (0)