@@ -41,7 +41,13 @@ declare namespace Line {
41
41
export type UnfollowEvent = { type : "unfollow" } & EventBase ;
42
42
export type JoinEvent = { type : "join" } & ReplyableEvent ;
43
43
export type LeaveEvent = { type : "leave" } & EventBase ;
44
- export type PostbackEvent = { type : "postback" , postback : { data : string } } & ReplyableEvent ;
44
+ export type PostbackEvent = {
45
+ type : "postback" ,
46
+ postback : {
47
+ data : string ,
48
+ params ?: string ,
49
+ } ,
50
+ } & ReplyableEvent ;
45
51
export type BeaconEvent = ReplyableEvent & {
46
52
type : "beacon" ,
47
53
beacon : {
@@ -129,41 +135,62 @@ declare namespace Line {
129
135
130
136
export type ImageMapArea = { x : number , y : number , width : number , height : number } ;
131
137
132
- export type TemplateContent = TemplateButtons | TemplateConfirm | TemplateCarousel ;
138
+ export type TemplateContent = TemplateButtons | TemplateConfirm | TemplateCarousel | TemplateImageCarousel ;
133
139
export type TemplateButtons = {
134
140
type : "buttons" ,
135
141
thumbnailImageUrl ?: string ,
136
142
title ?: string ,
137
143
text : string ,
138
- actions : TemplateAction [ ] ,
144
+ actions : TemplateAction < { label : string } > [ ] ,
139
145
} ;
140
146
export type TemplateConfirm = {
141
147
type : "confirm" ,
142
148
text : string ,
143
- actions : TemplateAction [ ] ,
149
+ actions : TemplateAction < { label : string } > [ ] ,
144
150
} ;
145
151
export type TemplateCarousel = { type : "carousel" , columns : TemplateColumn [ ] } ;
146
152
147
153
export type TemplateColumn = {
148
154
thumbnailImageUrl ?: string ,
149
155
title ?: string ,
150
156
text : string ,
151
- actions : TemplateAction [ ] ,
157
+ actions : TemplateAction < { label : string } > [ ] ,
158
+ } ;
159
+
160
+ export type TemplateImageCarousel = {
161
+ type : "image_carousel" ,
162
+ columns : TemplateImageColumn ,
163
+ } ;
164
+
165
+ export type TemplateImageColumn = {
166
+ imageUrl : string ,
167
+ action : TemplateAction < { label ?: string } > ,
152
168
} ;
153
169
154
- export type TemplateAction = TemplatePostbackAction | TemplateMessageAction | TemplateURIAction ;
155
- export type TemplateActionBase = { label : string } ;
170
+ export type TemplateAction < Label > =
171
+ | TemplatePostbackAction & Label
172
+ | TemplateMessageAction & Label
173
+ | TemplateURIAction & Label
174
+ | TemplateDatetimePickerAction & Label ;
156
175
export type TemplatePostbackAction = {
157
176
type : "postback" ,
158
177
data : string ,
159
178
text ?: string ,
160
- } & TemplateActionBase ;
179
+ } ;
161
180
export type TemplateMessageAction = {
162
181
type : "message" ,
163
182
text : string ,
164
- } & TemplateActionBase ;
183
+ } ;
165
184
export type TemplateURIAction = {
166
- type : "template " ,
185
+ type : "uri " ,
167
186
uri : string ,
168
- } & TemplateActionBase ;
187
+ } ;
188
+ export type TemplateDatetimePickerAction = {
189
+ type : "datetimepicker" ,
190
+ data : string ,
191
+ mode : "date" | "time" | "datetime" ,
192
+ initial ?: string ,
193
+ max ?: string ,
194
+ min ?: string ,
195
+ } ;
169
196
}
0 commit comments