@satorijs/adapter-lark 3.11.0 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/content.d.ts +211 -93
- package/lib/index.cjs +74 -104
- package/lib/message.d.ts +2 -3
- package/package.json +1 -1
- package/src/content.ts +230 -107
- package/src/message.ts +72 -101
package/lib/content.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface MessageContent {
|
|
|
21
21
|
audio: MessageContent.Audio;
|
|
22
22
|
media: MessageContent.Media;
|
|
23
23
|
sticker: MessageContent.Sticker;
|
|
24
|
+
interactive: MessageContent.Card;
|
|
24
25
|
share_chat: MessageContent.ShareChat;
|
|
25
26
|
share_user: MessageContent.ShareUser;
|
|
26
27
|
system: MessageContent.System;
|
|
@@ -102,63 +103,171 @@ export declare namespace MessageContent {
|
|
|
102
103
|
language?: string;
|
|
103
104
|
text: string;
|
|
104
105
|
}
|
|
105
|
-
interface
|
|
106
|
+
interface HrElement extends BaseElement<'hr'> {
|
|
106
107
|
}
|
|
107
108
|
interface MarkdownElement extends BaseElement<'md'> {
|
|
108
109
|
text: string;
|
|
109
110
|
}
|
|
110
111
|
type InlineElement = TextElement | LinkElement | AtElement | EmotionElement | MarkdownElement;
|
|
111
|
-
type BlockElement = ImageElement | MediaElement | CodeBlockElement |
|
|
112
|
+
type BlockElement = ImageElement | MediaElement | CodeBlockElement | HrElement;
|
|
112
113
|
type Paragraph = InlineElement[] | [BlockElement];
|
|
113
114
|
}
|
|
114
115
|
interface Card {
|
|
116
|
+
schema: '2.0';
|
|
115
117
|
config?: Card.Config;
|
|
116
|
-
card_link?: Card.
|
|
118
|
+
card_link?: Card.Urls;
|
|
117
119
|
header?: Card.Header;
|
|
118
|
-
|
|
120
|
+
body: Card.Body;
|
|
119
121
|
}
|
|
120
122
|
namespace Card {
|
|
121
123
|
/** @see https://open.larksuite.com/document/common-capabilities/message-card/getting-started/card-structure/card-configuration */
|
|
122
124
|
interface Config {
|
|
125
|
+
streaming_mode?: boolean;
|
|
126
|
+
streaming_config?: StreamingConfig;
|
|
127
|
+
summary: {
|
|
128
|
+
content: string;
|
|
129
|
+
i18n_content?: Record<string, string>;
|
|
130
|
+
};
|
|
131
|
+
locales: string[];
|
|
123
132
|
enable_forward?: boolean;
|
|
124
133
|
update_multi?: boolean;
|
|
134
|
+
width_mode?: 'compact' | 'fill';
|
|
135
|
+
use_custom_translation?: boolean;
|
|
136
|
+
enable_forward_interaction?: boolean;
|
|
137
|
+
style?: {
|
|
138
|
+
text_size?: {
|
|
139
|
+
'cus-0': Record<'default' | 'android' | 'ios' | 'pc', 'medium' | 'large'>;
|
|
140
|
+
};
|
|
141
|
+
color?: {
|
|
142
|
+
'cus-0': Record<'light_mode' | 'dark_mode', string>;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
interface StreamingConfig {
|
|
147
|
+
print_frequency_ms?: Record<'default' | 'android' | 'ios' | 'pc', number>;
|
|
148
|
+
print_step?: Record<'default' | 'android' | 'ios' | 'pc', number>;
|
|
149
|
+
print_strategy?: 'fast' | 'delay';
|
|
125
150
|
}
|
|
126
|
-
interface
|
|
151
|
+
interface Urls {
|
|
127
152
|
url: string;
|
|
128
153
|
pc_url?: string;
|
|
129
154
|
ios_url?: string;
|
|
130
155
|
android_url?: string;
|
|
131
156
|
}
|
|
132
|
-
/** @see https://open.
|
|
157
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/title */
|
|
133
158
|
interface Header {
|
|
134
|
-
title:
|
|
135
|
-
subtitle?:
|
|
159
|
+
title: I18nTextElement;
|
|
160
|
+
subtitle?: I18nTextElement;
|
|
136
161
|
template?: Header.Template;
|
|
137
162
|
icon?: CustomIconElement;
|
|
138
163
|
ud_icon?: StandardIconElement;
|
|
139
164
|
text_tag_list?: TextTagElement[];
|
|
140
165
|
i18n_text_tag_list?: Record<string, TextTagElement[]>;
|
|
166
|
+
padding?: string;
|
|
141
167
|
}
|
|
142
168
|
namespace Header {
|
|
143
169
|
type Template = 'blue' | 'wathet' | 'turquoise' | 'green' | 'yellow' | 'orange' | 'red' | 'carmine' | 'violet' | 'purple' | 'indigo' | 'grey' | 'default';
|
|
144
170
|
}
|
|
171
|
+
interface Body {
|
|
172
|
+
direction?: 'vertical' | 'horizontal';
|
|
173
|
+
padding?: string;
|
|
174
|
+
horizontal_spacing?: string;
|
|
175
|
+
horizontal_align?: 'left' | 'center' | 'right';
|
|
176
|
+
vertical_spacing?: string;
|
|
177
|
+
vertical_align?: 'top' | 'center' | 'bottom';
|
|
178
|
+
elements: Element[];
|
|
179
|
+
}
|
|
145
180
|
interface BaseElement<T extends string = string> {
|
|
146
181
|
tag: T;
|
|
182
|
+
margin?: string;
|
|
183
|
+
element_id?: string;
|
|
184
|
+
}
|
|
185
|
+
interface BaseContainerElement<T extends string = string> extends BaseElement<T> {
|
|
186
|
+
vertical_align?: 'top' | 'center' | 'bottom';
|
|
187
|
+
vertical_spacing?: string;
|
|
188
|
+
horizontal_align?: 'left' | 'center' | 'right';
|
|
189
|
+
horizontal_spacing?: string;
|
|
190
|
+
direction?: 'vertical' | 'horizontal';
|
|
191
|
+
padding?: string;
|
|
192
|
+
elements: Element[];
|
|
193
|
+
}
|
|
194
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/column-set */
|
|
195
|
+
interface ColumnSetElement extends BaseElement<'column_set'> {
|
|
196
|
+
horizontal_spacing?: string;
|
|
197
|
+
horizontal_align?: 'left' | 'center' | 'right';
|
|
198
|
+
vertical_align?: 'center';
|
|
199
|
+
flex_mode?: 'none' | 'stretch' | 'flow' | 'bisect' | 'trisect';
|
|
200
|
+
background_style?: string;
|
|
201
|
+
columns: ColumnElement[];
|
|
202
|
+
action?: {
|
|
203
|
+
multi_url: Urls;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
interface ColumnElement extends BaseContainerElement<'column'> {
|
|
207
|
+
background_style?: string;
|
|
208
|
+
width?: 'auto' | 'weighted' | string;
|
|
209
|
+
weight?: number;
|
|
210
|
+
action?: {
|
|
211
|
+
multi_url: Urls;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/form-container */
|
|
215
|
+
interface FormElement extends BaseContainerElement<'form'> {
|
|
216
|
+
name: string;
|
|
217
|
+
confirm?: ConfirmElement;
|
|
218
|
+
}
|
|
219
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/interactive-container */
|
|
220
|
+
interface InteractiveContainerElement extends BaseContainerElement<'interactive_container'> {
|
|
221
|
+
width?: string;
|
|
222
|
+
height?: string;
|
|
223
|
+
background_style?: string;
|
|
224
|
+
has_border?: boolean;
|
|
225
|
+
border_color?: string;
|
|
226
|
+
corner_radius?: string;
|
|
227
|
+
behaviors: ActionBehavior[];
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
disabled_tips?: TextElement;
|
|
230
|
+
confirm?: ConfirmElement;
|
|
231
|
+
hover_tips?: TextElement;
|
|
232
|
+
}
|
|
233
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/collapsible-panel */
|
|
234
|
+
interface CollapsiblePanelElement extends BaseContainerElement<'collapsible_panel'> {
|
|
235
|
+
expanded?: boolean;
|
|
236
|
+
background_color?: string;
|
|
237
|
+
header: CollapsiblePanelElement.Header;
|
|
238
|
+
border?: {
|
|
239
|
+
color?: string;
|
|
240
|
+
corner_radius?: string;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
namespace CollapsiblePanelElement {
|
|
244
|
+
interface Header {
|
|
245
|
+
title: TextElement | MarkdownElement;
|
|
246
|
+
background_color?: string;
|
|
247
|
+
vertical_align?: 'center' | 'top' | 'bottom';
|
|
248
|
+
padding?: string;
|
|
249
|
+
position?: 'top' | 'bottom';
|
|
250
|
+
width?: string;
|
|
251
|
+
icon?: IconElement & {
|
|
252
|
+
size?: string;
|
|
253
|
+
};
|
|
254
|
+
icon_position?: 'left' | 'right' | 'follow_text';
|
|
255
|
+
icon_expanded_angle?: number;
|
|
256
|
+
}
|
|
147
257
|
}
|
|
148
258
|
type TextSize = 'heading-0' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading' | 'normal' | 'notation' | 'xxxx-large' | 'xxx-large' | 'xx-large' | 'x-large' | 'large' | 'medium' | 'small' | 'x-small';
|
|
149
259
|
type TextAlign = 'left' | 'center' | 'right';
|
|
150
|
-
interface
|
|
260
|
+
interface TextElement<T extends string = 'plain_text'> extends BaseElement<T> {
|
|
151
261
|
content: string;
|
|
152
262
|
}
|
|
153
|
-
interface
|
|
154
|
-
|
|
263
|
+
interface I18nTextElement extends TextElement<'plain_text' | 'lark_md'> {
|
|
264
|
+
i18n_content?: Record<string, string>;
|
|
155
265
|
}
|
|
156
|
-
interface
|
|
266
|
+
interface DivTextElement extends TextElement<'plain_text' | 'lark_md'> {
|
|
157
267
|
text_size?: TextSize;
|
|
158
268
|
text_color?: string;
|
|
159
269
|
text_align?: TextAlign;
|
|
160
270
|
lines?: number;
|
|
161
|
-
icon?: IconElement;
|
|
162
271
|
}
|
|
163
272
|
type IconElement = StandardIconElement | CustomIconElement;
|
|
164
273
|
interface CustomIconElement extends BaseElement<'custom_icon'> {
|
|
@@ -169,45 +278,60 @@ export declare namespace MessageContent {
|
|
|
169
278
|
color?: string;
|
|
170
279
|
}
|
|
171
280
|
interface TextTagElement extends BaseElement<'text_tag'> {
|
|
172
|
-
text:
|
|
281
|
+
text: TextElement;
|
|
173
282
|
color: TextTagElement.Color;
|
|
174
283
|
}
|
|
175
284
|
namespace TextTagElement {
|
|
176
285
|
type Color = 'neutral' | 'blue' | 'torqoise' | 'lime' | 'orange' | 'violet' | 'indigo' | 'wathet' | 'green' | 'yellow' | 'red' | 'purple' | 'carmine';
|
|
177
286
|
}
|
|
178
|
-
interface BaseImageElement extends BaseElement<'
|
|
287
|
+
interface BaseImageElement extends BaseElement<'img'> {
|
|
179
288
|
img_key: string;
|
|
180
|
-
alt?:
|
|
289
|
+
alt?: TextElement;
|
|
181
290
|
}
|
|
291
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/image */
|
|
182
292
|
interface ImageElement extends BaseImageElement {
|
|
183
|
-
title?:
|
|
293
|
+
title?: TextElement;
|
|
184
294
|
transparent?: string;
|
|
185
295
|
preview?: boolean;
|
|
186
296
|
corner_radius?: string;
|
|
187
297
|
scale_type?: 'crop_center' | 'fit_horizontal' | 'crop_top';
|
|
188
298
|
size?: 'large' | 'medium' | 'small' | 'tiny' | 'stretch_without_padding' | 'stretch' | string;
|
|
189
|
-
/** @deprecated */
|
|
190
|
-
custom_width?: number;
|
|
191
|
-
/** @deprecated */
|
|
192
|
-
compact_width?: boolean;
|
|
193
|
-
/** @deprecated */
|
|
194
299
|
mode?: 'crop_center' | 'fit_horizontal' | 'large' | 'medium' | 'small' | 'tiny';
|
|
195
300
|
}
|
|
196
|
-
|
|
301
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/multi-image-laylout */
|
|
302
|
+
interface ImageCombinationElement extends BaseElement<'img_combination'> {
|
|
303
|
+
combination_mode?: 'double' | 'triple' | 'bisect' | 'trisect';
|
|
304
|
+
combination_transparent?: boolean;
|
|
305
|
+
corner_radius?: string;
|
|
306
|
+
img_list?: {
|
|
307
|
+
img_key: string;
|
|
308
|
+
}[];
|
|
309
|
+
}
|
|
310
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/divider */
|
|
311
|
+
interface HrElement extends BaseElement<'hr'> {
|
|
197
312
|
}
|
|
313
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/plain-text */
|
|
198
314
|
interface DivElement extends BaseElement<'div'> {
|
|
199
|
-
text?:
|
|
315
|
+
text?: DivTextElement;
|
|
316
|
+
width?: string;
|
|
317
|
+
icon?: IconElement;
|
|
200
318
|
}
|
|
319
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/rich-text */
|
|
201
320
|
interface MarkdownElement extends BaseElement<'markdown'> {
|
|
202
321
|
content: string;
|
|
203
322
|
text_size?: TextSize;
|
|
204
323
|
text_align?: TextAlign;
|
|
205
|
-
|
|
324
|
+
icon?: IconElement;
|
|
206
325
|
}
|
|
326
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/user-profile */
|
|
207
327
|
interface PersonElement extends BaseElement<'person'> {
|
|
208
328
|
user_id: string;
|
|
209
329
|
size?: 'large' | 'medium' | 'small' | 'extra_small';
|
|
330
|
+
show_avatar?: boolean;
|
|
331
|
+
show_name?: boolean;
|
|
332
|
+
style?: 'normal' | 'capsule';
|
|
210
333
|
}
|
|
334
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/user-list */
|
|
211
335
|
interface PersonListElement extends BaseElement<'person_list'> {
|
|
212
336
|
persons: {
|
|
213
337
|
id: string;
|
|
@@ -215,7 +339,11 @@ export declare namespace MessageContent {
|
|
|
215
339
|
size?: 'large' | 'medium' | 'small' | 'extra_small';
|
|
216
340
|
show_name?: boolean;
|
|
217
341
|
show_avatar?: boolean;
|
|
342
|
+
lines?: number;
|
|
343
|
+
drop_invalid_user_id?: string;
|
|
344
|
+
icon?: IconElement;
|
|
218
345
|
}
|
|
346
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/chart */
|
|
219
347
|
interface ChartElement extends BaseElement<'chart'> {
|
|
220
348
|
chart_spec: {};
|
|
221
349
|
aspect_ratio?: '1:1' | '2:1' | '4:3' | '16:9';
|
|
@@ -223,9 +351,12 @@ export declare namespace MessageContent {
|
|
|
223
351
|
preview?: boolean;
|
|
224
352
|
height?: 'auto' | string;
|
|
225
353
|
}
|
|
354
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/table */
|
|
226
355
|
interface TableElement extends BaseElement<'table'> {
|
|
227
356
|
page_size?: number;
|
|
228
357
|
row_height?: 'low' | 'medium' | 'high' | string;
|
|
358
|
+
row_max_height?: string;
|
|
359
|
+
freeze_first_column?: boolean;
|
|
229
360
|
header_style?: TableElement.HeaderStyle;
|
|
230
361
|
columns: TableElement.Column[];
|
|
231
362
|
rows: object[];
|
|
@@ -243,6 +374,7 @@ export declare namespace MessageContent {
|
|
|
243
374
|
name: string;
|
|
244
375
|
display_name?: string;
|
|
245
376
|
width?: 'auto' | string;
|
|
377
|
+
vertical_align?: 'top' | 'center' | 'bottom';
|
|
246
378
|
horizontal_align?: 'left' | 'center' | 'right';
|
|
247
379
|
data_type?: 'text' | 'lark_md' | 'options' | 'number' | 'persons' | 'date' | 'markdown';
|
|
248
380
|
format?: {
|
|
@@ -253,23 +385,8 @@ export declare namespace MessageContent {
|
|
|
253
385
|
date_format?: string;
|
|
254
386
|
}
|
|
255
387
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
namespace NoteElement {
|
|
260
|
-
type InnerElement = IconElement | PlainTextElement | BaseImageElement;
|
|
261
|
-
}
|
|
262
|
-
interface FormElement extends BaseElement<'form'> {
|
|
263
|
-
name: string;
|
|
264
|
-
elements: Element[];
|
|
265
|
-
confirm?: ConfirmElement;
|
|
266
|
-
}
|
|
267
|
-
interface ActionElement extends BaseElement<'action'> {
|
|
268
|
-
actions: Element[];
|
|
269
|
-
layout?: 'bisected' | 'trisection' | 'flow';
|
|
270
|
-
}
|
|
271
|
-
type ActionBehavior = OpenURLBehavior | CallbackBehavior;
|
|
272
|
-
interface OpenURLBehavior {
|
|
388
|
+
type ActionBehavior = OpenUrlBehavior | CallbackBehavior;
|
|
389
|
+
interface OpenUrlBehavior {
|
|
273
390
|
type: 'open_url';
|
|
274
391
|
default_url: string;
|
|
275
392
|
pc_url?: string;
|
|
@@ -281,38 +398,35 @@ export declare namespace MessageContent {
|
|
|
281
398
|
value: Record<string, string>;
|
|
282
399
|
}
|
|
283
400
|
interface BaseButtonElement extends BaseElement<'button'> {
|
|
284
|
-
text:
|
|
401
|
+
text: TextElement;
|
|
285
402
|
size?: ButtonElement.Size;
|
|
286
403
|
icon?: IconElement;
|
|
287
404
|
disabled?: boolean;
|
|
288
405
|
behaviors?: ActionBehavior[];
|
|
289
406
|
}
|
|
407
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/button */
|
|
290
408
|
interface ButtonElement extends BaseButtonElement {
|
|
291
409
|
type?: ButtonElement.Type;
|
|
292
410
|
width?: ButtonElement.Width;
|
|
293
|
-
hover_tips?:
|
|
294
|
-
disabled_tips?:
|
|
295
|
-
confirm?:
|
|
296
|
-
title: PlainTextElement;
|
|
297
|
-
text: PlainTextElement;
|
|
298
|
-
};
|
|
411
|
+
hover_tips?: TextElement;
|
|
412
|
+
disabled_tips?: TextElement;
|
|
413
|
+
confirm?: ConfirmElement;
|
|
299
414
|
name?: string;
|
|
300
415
|
required?: boolean;
|
|
301
|
-
|
|
302
|
-
value?: Record<string, string>;
|
|
303
|
-
url?: string;
|
|
304
|
-
multi_url?: Omit<URLs, 'url'>;
|
|
416
|
+
form_action_type?: 'submit' | 'reset';
|
|
305
417
|
}
|
|
306
418
|
interface ConfirmElement {
|
|
307
|
-
title:
|
|
308
|
-
text:
|
|
419
|
+
title: TextElement;
|
|
420
|
+
text: TextElement;
|
|
309
421
|
}
|
|
422
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/input */
|
|
310
423
|
interface InputElement extends BaseElement<'input'> {
|
|
311
|
-
name
|
|
424
|
+
name?: string;
|
|
312
425
|
required?: boolean;
|
|
313
|
-
placeholder?:
|
|
426
|
+
placeholder?: TextElement;
|
|
314
427
|
default_value?: string;
|
|
315
428
|
disabled?: boolean;
|
|
429
|
+
disabled_tips?: TextElement;
|
|
316
430
|
width?: 'default' | 'fill' | string;
|
|
317
431
|
max_length?: number;
|
|
318
432
|
input_type?: 'text' | 'multiline_text' | 'password';
|
|
@@ -320,16 +434,13 @@ export declare namespace MessageContent {
|
|
|
320
434
|
rows?: number;
|
|
321
435
|
auto_resize?: boolean;
|
|
322
436
|
max_rows?: number;
|
|
323
|
-
label?:
|
|
437
|
+
label?: TextElement;
|
|
324
438
|
label_position?: 'top' | 'left';
|
|
325
439
|
value?: string | object;
|
|
326
440
|
behaviors?: ActionBehavior[];
|
|
327
441
|
confirm?: ConfirmElement;
|
|
328
|
-
fallback?: {
|
|
329
|
-
tag?: string;
|
|
330
|
-
text?: PlainTextElement;
|
|
331
|
-
};
|
|
332
442
|
}
|
|
443
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/overflow */
|
|
333
444
|
interface OverflowElement extends BaseElement<'overflow'> {
|
|
334
445
|
width?: 'default' | 'fill' | string;
|
|
335
446
|
options: OverflowElement.Option[];
|
|
@@ -338,8 +449,8 @@ export declare namespace MessageContent {
|
|
|
338
449
|
}
|
|
339
450
|
namespace OverflowElement {
|
|
340
451
|
interface Option {
|
|
341
|
-
text?:
|
|
342
|
-
multi_url?:
|
|
452
|
+
text?: TextElement;
|
|
453
|
+
multi_url?: Urls;
|
|
343
454
|
value?: string;
|
|
344
455
|
}
|
|
345
456
|
}
|
|
@@ -348,101 +459,108 @@ export declare namespace MessageContent {
|
|
|
348
459
|
name?: string;
|
|
349
460
|
required?: boolean;
|
|
350
461
|
disabled?: boolean;
|
|
351
|
-
placeholder?:
|
|
462
|
+
placeholder?: TextElement;
|
|
352
463
|
width?: 'default' | 'fill' | string;
|
|
353
464
|
confirm?: ConfirmElement;
|
|
465
|
+
behaviors?: ActionBehavior[];
|
|
354
466
|
}
|
|
355
467
|
interface OptionElement {
|
|
356
|
-
text:
|
|
468
|
+
text: TextElement;
|
|
357
469
|
icon?: IconElement;
|
|
358
470
|
value: string;
|
|
359
471
|
}
|
|
472
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/single-select-dropdown-menu */
|
|
360
473
|
interface SelectElement extends BaseSelectElement<'select_static'> {
|
|
361
474
|
options: OptionElement[];
|
|
362
475
|
initial_option?: string;
|
|
363
476
|
behaviors?: ActionBehavior[];
|
|
364
477
|
}
|
|
478
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/multi-select-dropdown-menu */
|
|
365
479
|
interface MultiSelectElement extends BaseSelectElement<'multi_select_static'> {
|
|
366
480
|
options: OptionElement[];
|
|
367
481
|
selected_values?: string[];
|
|
368
482
|
}
|
|
483
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/single-select-user-picker */
|
|
369
484
|
interface SelectPersonElement extends BaseSelectElement<'select_person'> {
|
|
370
|
-
options
|
|
485
|
+
options: {
|
|
371
486
|
value: string;
|
|
372
487
|
}[];
|
|
373
488
|
}
|
|
489
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/multi-select-user-picker */
|
|
374
490
|
interface MultiSelectPersonElement extends BaseSelectElement<'multi_select_person'> {
|
|
375
|
-
options
|
|
491
|
+
options: {
|
|
376
492
|
value: string;
|
|
377
493
|
}[];
|
|
378
494
|
selected_values?: string[];
|
|
379
495
|
}
|
|
496
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/date-picker */
|
|
380
497
|
interface DatePickerElement extends BaseSelectElement<'date_picker'> {
|
|
381
498
|
initial_date?: string;
|
|
382
499
|
value?: object;
|
|
383
500
|
}
|
|
501
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/time-selector */
|
|
384
502
|
interface TimePickerElement extends BaseSelectElement<'picker_time'> {
|
|
385
503
|
initial_time?: string;
|
|
386
504
|
value?: object;
|
|
387
505
|
}
|
|
506
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/date-time-picker */
|
|
388
507
|
interface DateTimePickerElement extends BaseSelectElement<'picker_datetime'> {
|
|
389
508
|
initial_datetime?: string;
|
|
390
509
|
value?: object;
|
|
391
510
|
}
|
|
511
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/image-picker */
|
|
512
|
+
interface SelectImageElement extends BaseSelectElement<'select_img'> {
|
|
513
|
+
multi_select?: boolean;
|
|
514
|
+
layout?: 'stretch' | 'bisect' | 'trisect';
|
|
515
|
+
can_preview?: boolean;
|
|
516
|
+
aspect_ratio?: '1:1' | '4:3' | '16:9';
|
|
517
|
+
disabled_tips?: TextElement;
|
|
518
|
+
value?: string | object;
|
|
519
|
+
options?: {
|
|
520
|
+
img_key: string;
|
|
521
|
+
value?: string;
|
|
522
|
+
disabled?: boolean;
|
|
523
|
+
disabled_tips?: TextElement;
|
|
524
|
+
hover_tips?: TextElement;
|
|
525
|
+
}[];
|
|
526
|
+
}
|
|
527
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/checker */
|
|
392
528
|
interface CheckerElement extends BaseElement<'checker'> {
|
|
393
529
|
name?: string;
|
|
394
530
|
checked?: boolean;
|
|
395
531
|
disabled?: boolean;
|
|
396
|
-
text?: CheckerElement.
|
|
532
|
+
text?: CheckerElement.Text;
|
|
397
533
|
overall_checkable?: boolean;
|
|
398
534
|
button_area?: {
|
|
399
535
|
pc_display_rule?: 'always' | 'on_hover';
|
|
400
|
-
buttons?: CheckerElement.
|
|
536
|
+
buttons?: CheckerElement.Button[];
|
|
401
537
|
};
|
|
402
538
|
checked_style?: {
|
|
403
539
|
show_strikethrough?: boolean;
|
|
404
540
|
opacity?: number;
|
|
405
541
|
};
|
|
406
|
-
margin?: string;
|
|
407
542
|
padding?: string;
|
|
408
543
|
confirm?: ConfirmElement;
|
|
409
544
|
behaviors?: ActionBehavior[];
|
|
410
|
-
hover_tips?:
|
|
411
|
-
disable_tips?:
|
|
545
|
+
hover_tips?: TextElement;
|
|
546
|
+
disable_tips?: TextElement;
|
|
412
547
|
}
|
|
413
548
|
namespace CheckerElement {
|
|
414
|
-
interface
|
|
549
|
+
interface Text extends Card.TextElement<'plain_text' | 'lark_md'> {
|
|
415
550
|
text_size?: 'normal' | 'heading' | 'notation';
|
|
416
551
|
text_color?: string;
|
|
417
552
|
text_align?: TextAlign;
|
|
418
553
|
}
|
|
419
|
-
interface
|
|
554
|
+
interface Button extends BaseButtonElement {
|
|
420
555
|
type: 'text' | 'primary_text' | 'danger_text';
|
|
421
556
|
}
|
|
422
557
|
}
|
|
423
|
-
interface ColumnSetElement extends BaseElement<'column_set'> {
|
|
424
|
-
horizontal_spacing?: string;
|
|
425
|
-
horizontal_align?: 'left' | 'center' | 'right';
|
|
426
|
-
margin?: string;
|
|
427
|
-
flex_mode?: 'none' | 'stretch' | 'flow' | 'bisect' | 'trisect';
|
|
428
|
-
background_style?: string;
|
|
429
|
-
columns: ColumnElement[];
|
|
430
|
-
}
|
|
431
|
-
interface ColumnElement extends BaseElement<'column'> {
|
|
432
|
-
background_style?: string;
|
|
433
|
-
width?: 'auto' | 'weighted' | string;
|
|
434
|
-
weight?: number;
|
|
435
|
-
vertical_align?: 'top' | 'center' | 'bottom';
|
|
436
|
-
vertical_spacing?: 'default' | 'medium' | 'large' | string;
|
|
437
|
-
padding?: string;
|
|
438
|
-
elements: Element[];
|
|
439
|
-
}
|
|
440
558
|
namespace ButtonElement {
|
|
441
559
|
type Size = 'tiny' | 'small' | 'medium' | 'large';
|
|
442
560
|
type Width = 'default' | 'fill' | string;
|
|
443
561
|
type Type = 'default' | 'primary' | 'danger' | 'text' | 'primary_text' | 'danger_text' | 'primary_filled' | 'danger_filled' | 'laser';
|
|
444
562
|
}
|
|
445
|
-
type Element = DivElement | MarkdownElement |
|
|
563
|
+
type Element = DivElement | MarkdownElement | HrElement | ChartElement | TableElement | ImageElement | FormElement | InputElement | ButtonElement | CheckerElement | ColumnSetElement | SelectElement | MultiSelectElement | SelectPersonElement | MultiSelectPersonElement | DatePickerElement | TimePickerElement | DateTimePickerElement | InteractiveContainerElement | CollapsiblePanelElement | OverflowElement;
|
|
446
564
|
}
|
|
447
565
|
interface Template {
|
|
448
566
|
type: 'template';
|