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