slackblock 2.0.0-beta.2 → 2.0.0-beta.3
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/CHANGELOG.md +6 -0
- package/README.md +18 -6
- package/dist/block.cjs.map +1 -1
- package/dist/block.d.cts +4 -2
- package/dist/block.d.ts +4 -2
- package/dist/block.mjs.map +1 -1
- package/dist/index.cjs +15 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.mjs +15 -7
- package/dist/index.mjs.map +1 -1
- package/dist/types-DhAVIy-s.d.cts +261 -0
- package/dist/types-DhAVIy-s.d.ts +261 -0
- package/package.json +1 -1
- package/dist/types.d-BHoTwZUO.d.cts +0 -124
- package/dist/types.d-BHoTwZUO.d.ts +0 -124
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { KnownBlock, Block as Block$1, MessageAttachment } from '@slack/types';
|
|
2
|
+
|
|
3
|
+
type TextType$1 = {
|
|
4
|
+
type: 'plain_text' | 'mrkdwn';
|
|
5
|
+
text: string;
|
|
6
|
+
emoji?: boolean;
|
|
7
|
+
verbatim?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type TextType = {
|
|
11
|
+
type: 'plain_text_input';
|
|
12
|
+
action_id: string;
|
|
13
|
+
placeholder?: TextType$1;
|
|
14
|
+
initial_value?: string;
|
|
15
|
+
multiline?: boolean;
|
|
16
|
+
min_length?: number;
|
|
17
|
+
max_length?: number;
|
|
18
|
+
focus_on_load?: boolean;
|
|
19
|
+
dispatch_action_config?: {
|
|
20
|
+
trigger_actions_on: Array<'on_enter_pressed' | 'on_character_entered'>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type ConfirmationType = {
|
|
25
|
+
title: TextType$1;
|
|
26
|
+
text: TextType$1;
|
|
27
|
+
confirm: TextType$1;
|
|
28
|
+
deny: TextType$1;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type DatePickerType = {
|
|
32
|
+
type: 'datepicker';
|
|
33
|
+
action_id: string;
|
|
34
|
+
placeholder?: TextType$1;
|
|
35
|
+
initial_date?: string;
|
|
36
|
+
confirm?: ConfirmationType;
|
|
37
|
+
focus_on_load?: boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type OptionType = {
|
|
41
|
+
text: TextType$1;
|
|
42
|
+
value: string;
|
|
43
|
+
description?: TextType$1;
|
|
44
|
+
url?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type OptionGroupType = {
|
|
48
|
+
label: TextType$1;
|
|
49
|
+
options: OptionType[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type ValidSelectType = 'static_select' | 'multi_static_select' | 'external_select' | 'multi_external_select' | 'users_select' | 'multi_users_select' | 'conversations_select' | 'multi_conversations_select' | 'channels_select' | 'multi_channels_select';
|
|
53
|
+
type SelectType = {
|
|
54
|
+
type: ValidSelectType;
|
|
55
|
+
placeholder: TextType$1;
|
|
56
|
+
action_id: string;
|
|
57
|
+
options?: OptionType[];
|
|
58
|
+
option_groups?: OptionGroupType[];
|
|
59
|
+
initial_option?: OptionType;
|
|
60
|
+
initial_options?: OptionType[];
|
|
61
|
+
confirm?: ConfirmationType;
|
|
62
|
+
max_selected_items?: number;
|
|
63
|
+
min_query_length?: number;
|
|
64
|
+
focus_on_load?: boolean;
|
|
65
|
+
initial_user?: string;
|
|
66
|
+
initial_users?: string[];
|
|
67
|
+
initial_conversation?: string;
|
|
68
|
+
initial_conversations?: string[];
|
|
69
|
+
initial_channel?: string;
|
|
70
|
+
initial_channels?: string[];
|
|
71
|
+
default_to_current_conversation?: boolean;
|
|
72
|
+
response_url_enabled?: boolean;
|
|
73
|
+
filter?: {
|
|
74
|
+
include?: Array<'im' | 'mpim' | 'private' | 'public'>;
|
|
75
|
+
exclude_external_shared_channels?: boolean;
|
|
76
|
+
exclude_bot_users?: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type CheckboxesType = {
|
|
81
|
+
type: 'checkboxes';
|
|
82
|
+
action_id: string;
|
|
83
|
+
options: OptionType[];
|
|
84
|
+
initial_options?: OptionType[];
|
|
85
|
+
confirm?: ConfirmationType;
|
|
86
|
+
focus_on_load?: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type TimePickerType = {
|
|
90
|
+
type: 'timepicker';
|
|
91
|
+
action_id: string;
|
|
92
|
+
placeholder?: TextType$1;
|
|
93
|
+
initial_time?: string;
|
|
94
|
+
confirm?: ConfirmationType;
|
|
95
|
+
focus_on_load?: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type DateTimePickerType = {
|
|
99
|
+
type: 'datetimepicker';
|
|
100
|
+
action_id: string;
|
|
101
|
+
initial_date_time?: number;
|
|
102
|
+
confirm?: ConfirmationType;
|
|
103
|
+
focus_on_load?: boolean;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type OverflowType = {
|
|
107
|
+
type: 'overflow';
|
|
108
|
+
action_id: string;
|
|
109
|
+
options: OptionType[];
|
|
110
|
+
confirm?: ConfirmationType;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type RadioGroupType = {
|
|
114
|
+
type: 'radio_buttons';
|
|
115
|
+
action_id: string;
|
|
116
|
+
options: OptionType[];
|
|
117
|
+
initial_option?: OptionType;
|
|
118
|
+
confirm?: ConfirmationType;
|
|
119
|
+
focus_on_load?: boolean;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type ImageType$1 = {
|
|
123
|
+
type: 'image';
|
|
124
|
+
image_url: string;
|
|
125
|
+
alt_text: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type ButtonType = {
|
|
129
|
+
type: 'button';
|
|
130
|
+
text: TextType$1;
|
|
131
|
+
action_id: string;
|
|
132
|
+
url?: string;
|
|
133
|
+
value?: string;
|
|
134
|
+
style?: 'primary' | 'danger';
|
|
135
|
+
confirm?: ConfirmationType;
|
|
136
|
+
accessibility_label?: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type ActionType = {
|
|
140
|
+
type: 'actions';
|
|
141
|
+
elements: SerializedInteractiveBlockElement[];
|
|
142
|
+
block_id?: string;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
type ImageOrText = ImageType$1 | TextType$1;
|
|
146
|
+
type ContextType = {
|
|
147
|
+
type: 'context';
|
|
148
|
+
elements: ImageOrText | ImageOrText[];
|
|
149
|
+
block_id?: string;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
type DividerType = {
|
|
153
|
+
type: 'divider';
|
|
154
|
+
block_id?: string;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type FileType = {
|
|
158
|
+
type: 'file';
|
|
159
|
+
source: 'remote';
|
|
160
|
+
external_id: string;
|
|
161
|
+
block_id?: string;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
type HeaderType = {
|
|
165
|
+
type: 'header';
|
|
166
|
+
text: TextType$1;
|
|
167
|
+
block_id?: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
type ImageType = {
|
|
171
|
+
type: 'image';
|
|
172
|
+
image_url: string;
|
|
173
|
+
alt_text: string;
|
|
174
|
+
title?: TextType$1;
|
|
175
|
+
block_id?: string;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
type InputType = {
|
|
179
|
+
type: 'input';
|
|
180
|
+
label: TextType$1;
|
|
181
|
+
element: SerializedInputBlockElement;
|
|
182
|
+
hint?: TextType$1;
|
|
183
|
+
optional?: boolean;
|
|
184
|
+
block_id?: string;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
type RichTextType = {
|
|
188
|
+
type: 'rich_text';
|
|
189
|
+
elements: Array<Record<string, unknown>>;
|
|
190
|
+
block_id?: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
type SectionType = {
|
|
194
|
+
type: 'section';
|
|
195
|
+
text: TextType$1;
|
|
196
|
+
block_id?: string;
|
|
197
|
+
fields?: TextType$1[];
|
|
198
|
+
accessory?: SerializedBlockElement;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
type VideoType = {
|
|
202
|
+
type: 'video';
|
|
203
|
+
title: TextType$1;
|
|
204
|
+
video_url: string;
|
|
205
|
+
thumbnail_url: string;
|
|
206
|
+
alt_text: string;
|
|
207
|
+
title_url?: string;
|
|
208
|
+
description?: TextType$1;
|
|
209
|
+
author_name?: string;
|
|
210
|
+
provider_name?: string;
|
|
211
|
+
provider_icon_url?: string;
|
|
212
|
+
block_id?: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
type ImageBlockType = ImageType$1 | ImageType;
|
|
216
|
+
type SerializedOption = OptionType | OptionGroupType;
|
|
217
|
+
type SerializedInputBlockElement = TextType | DatePickerType | DateTimePickerType | TimePickerType | CheckboxesType | SelectType | OverflowType | RadioGroupType;
|
|
218
|
+
type SerializedInteractiveBlockElement = ButtonType | SerializedInputBlockElement;
|
|
219
|
+
type SerializedBlockElement = TextType$1 | ImageBlockType | ConfirmationType | SerializedInteractiveBlockElement;
|
|
220
|
+
type SerializedBlock = SectionType | ActionType | ContextType | DividerType | FileType | HeaderType | ImageBlockType | InputType | RichTextType | VideoType;
|
|
221
|
+
type SerializedElement = SerializedBlock | SerializedBlockElement | SerializedInputBlockElement | SerializedOption;
|
|
222
|
+
type Block = KnownBlock | Block$1;
|
|
223
|
+
type Attachment = MessageAttachment;
|
|
224
|
+
type InteractiveBlockElement = JSX.Element;
|
|
225
|
+
type InputBlockElement = JSX.Element;
|
|
226
|
+
type BlockElement = JSX.Element;
|
|
227
|
+
type SlackMessageDraft = {
|
|
228
|
+
text: string;
|
|
229
|
+
blocks?: Block[];
|
|
230
|
+
attachments?: Attachment[];
|
|
231
|
+
channel?: string;
|
|
232
|
+
user?: string;
|
|
233
|
+
thread_ts?: string;
|
|
234
|
+
mrkdwn?: boolean;
|
|
235
|
+
icon_emoji?: string;
|
|
236
|
+
icon_url?: string;
|
|
237
|
+
parse?: 'full' | 'none';
|
|
238
|
+
username?: string;
|
|
239
|
+
as_user?: boolean;
|
|
240
|
+
reply_broadcast?: boolean;
|
|
241
|
+
unfurl_links?: boolean;
|
|
242
|
+
unfurl_media?: boolean;
|
|
243
|
+
};
|
|
244
|
+
type BoltCompatiblePayload = Omit<SlackMessageDraft, 'icon_emoji' | 'icon_url' | 'username' | 'as_user' | 'reply_broadcast' | 'channel' | 'user'>;
|
|
245
|
+
type SlackPostMessagePayload = BoltCompatiblePayload & {
|
|
246
|
+
channel: string;
|
|
247
|
+
};
|
|
248
|
+
type SlackPostEphemeralPayload = BoltCompatiblePayload & {
|
|
249
|
+
channel: string;
|
|
250
|
+
user: string;
|
|
251
|
+
};
|
|
252
|
+
type AnyFunction = (...parameters: unknown[]) => unknown;
|
|
253
|
+
type AnyConstructor = new (...parameters: unknown[]) => unknown;
|
|
254
|
+
type WithType = {
|
|
255
|
+
type?: string | AnyFunction | AnyConstructor;
|
|
256
|
+
};
|
|
257
|
+
type BElement = JSX.Element & WithType;
|
|
258
|
+
type Element = BElement;
|
|
259
|
+
type Child = string | Element | Child[] | boolean | undefined | null;
|
|
260
|
+
|
|
261
|
+
export type { BoltCompatiblePayload as B, Child as C, Element as E, InteractiveBlockElement as I, SlackPostEphemeralPayload as S, SlackPostMessagePayload as a, Block as b, SerializedBlock as c, SerializedElement as d, SerializedOption as e, SlackMessageDraft as f, InputBlockElement as g, BlockElement as h };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { KnownBlock, Block as Block$1, MessageAttachment } from '@slack/types';
|
|
2
|
+
|
|
3
|
+
type TextType$1 = {
|
|
4
|
+
type: 'plain_text' | 'mrkdwn';
|
|
5
|
+
text: string;
|
|
6
|
+
emoji?: boolean;
|
|
7
|
+
verbatim?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type TextType = {
|
|
11
|
+
type: 'plain_text_input';
|
|
12
|
+
action_id: string;
|
|
13
|
+
placeholder?: TextType$1;
|
|
14
|
+
initial_value?: string;
|
|
15
|
+
multiline?: boolean;
|
|
16
|
+
min_length?: number;
|
|
17
|
+
max_length?: number;
|
|
18
|
+
focus_on_load?: boolean;
|
|
19
|
+
dispatch_action_config?: {
|
|
20
|
+
trigger_actions_on: Array<'on_enter_pressed' | 'on_character_entered'>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type ConfirmationType = {
|
|
25
|
+
title: TextType$1;
|
|
26
|
+
text: TextType$1;
|
|
27
|
+
confirm: TextType$1;
|
|
28
|
+
deny: TextType$1;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type DatePickerType = {
|
|
32
|
+
type: 'datepicker';
|
|
33
|
+
action_id: string;
|
|
34
|
+
placeholder?: TextType$1;
|
|
35
|
+
initial_date?: string;
|
|
36
|
+
confirm?: ConfirmationType;
|
|
37
|
+
focus_on_load?: boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type OptionType = {
|
|
41
|
+
text: TextType$1;
|
|
42
|
+
value: string;
|
|
43
|
+
description?: TextType$1;
|
|
44
|
+
url?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type OptionGroupType = {
|
|
48
|
+
label: TextType$1;
|
|
49
|
+
options: OptionType[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type ValidSelectType = 'static_select' | 'multi_static_select' | 'external_select' | 'multi_external_select' | 'users_select' | 'multi_users_select' | 'conversations_select' | 'multi_conversations_select' | 'channels_select' | 'multi_channels_select';
|
|
53
|
+
type SelectType = {
|
|
54
|
+
type: ValidSelectType;
|
|
55
|
+
placeholder: TextType$1;
|
|
56
|
+
action_id: string;
|
|
57
|
+
options?: OptionType[];
|
|
58
|
+
option_groups?: OptionGroupType[];
|
|
59
|
+
initial_option?: OptionType;
|
|
60
|
+
initial_options?: OptionType[];
|
|
61
|
+
confirm?: ConfirmationType;
|
|
62
|
+
max_selected_items?: number;
|
|
63
|
+
min_query_length?: number;
|
|
64
|
+
focus_on_load?: boolean;
|
|
65
|
+
initial_user?: string;
|
|
66
|
+
initial_users?: string[];
|
|
67
|
+
initial_conversation?: string;
|
|
68
|
+
initial_conversations?: string[];
|
|
69
|
+
initial_channel?: string;
|
|
70
|
+
initial_channels?: string[];
|
|
71
|
+
default_to_current_conversation?: boolean;
|
|
72
|
+
response_url_enabled?: boolean;
|
|
73
|
+
filter?: {
|
|
74
|
+
include?: Array<'im' | 'mpim' | 'private' | 'public'>;
|
|
75
|
+
exclude_external_shared_channels?: boolean;
|
|
76
|
+
exclude_bot_users?: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type CheckboxesType = {
|
|
81
|
+
type: 'checkboxes';
|
|
82
|
+
action_id: string;
|
|
83
|
+
options: OptionType[];
|
|
84
|
+
initial_options?: OptionType[];
|
|
85
|
+
confirm?: ConfirmationType;
|
|
86
|
+
focus_on_load?: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type TimePickerType = {
|
|
90
|
+
type: 'timepicker';
|
|
91
|
+
action_id: string;
|
|
92
|
+
placeholder?: TextType$1;
|
|
93
|
+
initial_time?: string;
|
|
94
|
+
confirm?: ConfirmationType;
|
|
95
|
+
focus_on_load?: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type DateTimePickerType = {
|
|
99
|
+
type: 'datetimepicker';
|
|
100
|
+
action_id: string;
|
|
101
|
+
initial_date_time?: number;
|
|
102
|
+
confirm?: ConfirmationType;
|
|
103
|
+
focus_on_load?: boolean;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type OverflowType = {
|
|
107
|
+
type: 'overflow';
|
|
108
|
+
action_id: string;
|
|
109
|
+
options: OptionType[];
|
|
110
|
+
confirm?: ConfirmationType;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type RadioGroupType = {
|
|
114
|
+
type: 'radio_buttons';
|
|
115
|
+
action_id: string;
|
|
116
|
+
options: OptionType[];
|
|
117
|
+
initial_option?: OptionType;
|
|
118
|
+
confirm?: ConfirmationType;
|
|
119
|
+
focus_on_load?: boolean;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type ImageType$1 = {
|
|
123
|
+
type: 'image';
|
|
124
|
+
image_url: string;
|
|
125
|
+
alt_text: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type ButtonType = {
|
|
129
|
+
type: 'button';
|
|
130
|
+
text: TextType$1;
|
|
131
|
+
action_id: string;
|
|
132
|
+
url?: string;
|
|
133
|
+
value?: string;
|
|
134
|
+
style?: 'primary' | 'danger';
|
|
135
|
+
confirm?: ConfirmationType;
|
|
136
|
+
accessibility_label?: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type ActionType = {
|
|
140
|
+
type: 'actions';
|
|
141
|
+
elements: SerializedInteractiveBlockElement[];
|
|
142
|
+
block_id?: string;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
type ImageOrText = ImageType$1 | TextType$1;
|
|
146
|
+
type ContextType = {
|
|
147
|
+
type: 'context';
|
|
148
|
+
elements: ImageOrText | ImageOrText[];
|
|
149
|
+
block_id?: string;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
type DividerType = {
|
|
153
|
+
type: 'divider';
|
|
154
|
+
block_id?: string;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type FileType = {
|
|
158
|
+
type: 'file';
|
|
159
|
+
source: 'remote';
|
|
160
|
+
external_id: string;
|
|
161
|
+
block_id?: string;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
type HeaderType = {
|
|
165
|
+
type: 'header';
|
|
166
|
+
text: TextType$1;
|
|
167
|
+
block_id?: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
type ImageType = {
|
|
171
|
+
type: 'image';
|
|
172
|
+
image_url: string;
|
|
173
|
+
alt_text: string;
|
|
174
|
+
title?: TextType$1;
|
|
175
|
+
block_id?: string;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
type InputType = {
|
|
179
|
+
type: 'input';
|
|
180
|
+
label: TextType$1;
|
|
181
|
+
element: SerializedInputBlockElement;
|
|
182
|
+
hint?: TextType$1;
|
|
183
|
+
optional?: boolean;
|
|
184
|
+
block_id?: string;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
type RichTextType = {
|
|
188
|
+
type: 'rich_text';
|
|
189
|
+
elements: Array<Record<string, unknown>>;
|
|
190
|
+
block_id?: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
type SectionType = {
|
|
194
|
+
type: 'section';
|
|
195
|
+
text: TextType$1;
|
|
196
|
+
block_id?: string;
|
|
197
|
+
fields?: TextType$1[];
|
|
198
|
+
accessory?: SerializedBlockElement;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
type VideoType = {
|
|
202
|
+
type: 'video';
|
|
203
|
+
title: TextType$1;
|
|
204
|
+
video_url: string;
|
|
205
|
+
thumbnail_url: string;
|
|
206
|
+
alt_text: string;
|
|
207
|
+
title_url?: string;
|
|
208
|
+
description?: TextType$1;
|
|
209
|
+
author_name?: string;
|
|
210
|
+
provider_name?: string;
|
|
211
|
+
provider_icon_url?: string;
|
|
212
|
+
block_id?: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
type ImageBlockType = ImageType$1 | ImageType;
|
|
216
|
+
type SerializedOption = OptionType | OptionGroupType;
|
|
217
|
+
type SerializedInputBlockElement = TextType | DatePickerType | DateTimePickerType | TimePickerType | CheckboxesType | SelectType | OverflowType | RadioGroupType;
|
|
218
|
+
type SerializedInteractiveBlockElement = ButtonType | SerializedInputBlockElement;
|
|
219
|
+
type SerializedBlockElement = TextType$1 | ImageBlockType | ConfirmationType | SerializedInteractiveBlockElement;
|
|
220
|
+
type SerializedBlock = SectionType | ActionType | ContextType | DividerType | FileType | HeaderType | ImageBlockType | InputType | RichTextType | VideoType;
|
|
221
|
+
type SerializedElement = SerializedBlock | SerializedBlockElement | SerializedInputBlockElement | SerializedOption;
|
|
222
|
+
type Block = KnownBlock | Block$1;
|
|
223
|
+
type Attachment = MessageAttachment;
|
|
224
|
+
type InteractiveBlockElement = JSX.Element;
|
|
225
|
+
type InputBlockElement = JSX.Element;
|
|
226
|
+
type BlockElement = JSX.Element;
|
|
227
|
+
type SlackMessageDraft = {
|
|
228
|
+
text: string;
|
|
229
|
+
blocks?: Block[];
|
|
230
|
+
attachments?: Attachment[];
|
|
231
|
+
channel?: string;
|
|
232
|
+
user?: string;
|
|
233
|
+
thread_ts?: string;
|
|
234
|
+
mrkdwn?: boolean;
|
|
235
|
+
icon_emoji?: string;
|
|
236
|
+
icon_url?: string;
|
|
237
|
+
parse?: 'full' | 'none';
|
|
238
|
+
username?: string;
|
|
239
|
+
as_user?: boolean;
|
|
240
|
+
reply_broadcast?: boolean;
|
|
241
|
+
unfurl_links?: boolean;
|
|
242
|
+
unfurl_media?: boolean;
|
|
243
|
+
};
|
|
244
|
+
type BoltCompatiblePayload = Omit<SlackMessageDraft, 'icon_emoji' | 'icon_url' | 'username' | 'as_user' | 'reply_broadcast' | 'channel' | 'user'>;
|
|
245
|
+
type SlackPostMessagePayload = BoltCompatiblePayload & {
|
|
246
|
+
channel: string;
|
|
247
|
+
};
|
|
248
|
+
type SlackPostEphemeralPayload = BoltCompatiblePayload & {
|
|
249
|
+
channel: string;
|
|
250
|
+
user: string;
|
|
251
|
+
};
|
|
252
|
+
type AnyFunction = (...parameters: unknown[]) => unknown;
|
|
253
|
+
type AnyConstructor = new (...parameters: unknown[]) => unknown;
|
|
254
|
+
type WithType = {
|
|
255
|
+
type?: string | AnyFunction | AnyConstructor;
|
|
256
|
+
};
|
|
257
|
+
type BElement = JSX.Element & WithType;
|
|
258
|
+
type Element = BElement;
|
|
259
|
+
type Child = string | Element | Child[] | boolean | undefined | null;
|
|
260
|
+
|
|
261
|
+
export type { BoltCompatiblePayload as B, Child as C, Element as E, InteractiveBlockElement as I, SlackPostEphemeralPayload as S, SlackPostMessagePayload as a, Block as b, SerializedBlock as c, SerializedElement as d, SerializedOption as e, SlackMessageDraft as f, InputBlockElement as g, BlockElement as h };
|
package/package.json
CHANGED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { KnownBlock, Block as Block$1, MessageAttachment, MessageMetadata, EntityMetadata } from '@slack/types';
|
|
2
|
-
|
|
3
|
-
type Channel = {
|
|
4
|
-
channel: string;
|
|
5
|
-
};
|
|
6
|
-
type Text = {
|
|
7
|
-
text: string;
|
|
8
|
-
};
|
|
9
|
-
type MarkdownText = {
|
|
10
|
-
markdown_text: string;
|
|
11
|
-
};
|
|
12
|
-
type ChannelAndText = Channel & Text;
|
|
13
|
-
type ChannelAndBlocks = Channel & Partial<Text> & {
|
|
14
|
-
blocks: Array<KnownBlock | Block$1>;
|
|
15
|
-
};
|
|
16
|
-
type ChannelAndAttachments = Channel & Partial<Text> & {
|
|
17
|
-
attachments: MessageAttachment[];
|
|
18
|
-
};
|
|
19
|
-
type ChannelAndMarkdownText = Channel & MarkdownText;
|
|
20
|
-
type LinkNames = {
|
|
21
|
-
link_names?: boolean;
|
|
22
|
-
};
|
|
23
|
-
type Parse = {
|
|
24
|
-
parse?: 'full' | 'none';
|
|
25
|
-
};
|
|
26
|
-
type Unfurls = {
|
|
27
|
-
unfurl_links?: boolean;
|
|
28
|
-
unfurl_media?: boolean;
|
|
29
|
-
};
|
|
30
|
-
type IconEmoji = {
|
|
31
|
-
as_user?: false;
|
|
32
|
-
icon_url?: never;
|
|
33
|
-
icon_emoji?: string;
|
|
34
|
-
};
|
|
35
|
-
type IconURL = {
|
|
36
|
-
as_user?: false;
|
|
37
|
-
icon_emoji?: never;
|
|
38
|
-
icon_url?: string;
|
|
39
|
-
};
|
|
40
|
-
type Username = {
|
|
41
|
-
as_user?: false;
|
|
42
|
-
username?: string;
|
|
43
|
-
};
|
|
44
|
-
type WithinThreadReply = {
|
|
45
|
-
thread_ts?: string;
|
|
46
|
-
reply_broadcast?: false;
|
|
47
|
-
};
|
|
48
|
-
type BroadcastedThreadReply = {
|
|
49
|
-
thread_ts: string;
|
|
50
|
-
reply_broadcast: boolean;
|
|
51
|
-
};
|
|
52
|
-
type ChatPostMessageMetadata = {
|
|
53
|
-
metadata?: Partial<MessageMetadata> & {
|
|
54
|
-
entities?: EntityMetadata[];
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
type MessageContents = ChannelAndText | ChannelAndBlocks | ChannelAndAttachments | ChannelAndMarkdownText;
|
|
58
|
-
type ReplyInThread = WithinThreadReply | BroadcastedThreadReply;
|
|
59
|
-
type Authorship = ((IconEmoji | IconURL) & Username) | {
|
|
60
|
-
as_user: true;
|
|
61
|
-
icon_emoji?: never;
|
|
62
|
-
icon_url?: never;
|
|
63
|
-
username?: never;
|
|
64
|
-
};
|
|
65
|
-
type ChatPostMessageArguments = {
|
|
66
|
-
token?: string;
|
|
67
|
-
} & MessageContents & ReplyInThread & Authorship & Parse & LinkNames & ChatPostMessageMetadata & Unfurls & {
|
|
68
|
-
mrkdwn?: boolean;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
type Block = KnownBlock | Block$1;
|
|
72
|
-
|
|
73
|
-
type InteractiveBlockElement = JSX.Element;
|
|
74
|
-
|
|
75
|
-
type InputBlockElement = JSX.Element;
|
|
76
|
-
type BlockElement = JSX.Element;
|
|
77
|
-
|
|
78
|
-
type SlackMessageContents =
|
|
79
|
-
| Omit<ChannelAndText, 'channel'>
|
|
80
|
-
| Omit<ChannelAndBlocks, 'channel'>
|
|
81
|
-
| Omit<ChannelAndAttachments, 'channel'>
|
|
82
|
-
| Omit<ChannelAndMarkdownText, 'channel'>;
|
|
83
|
-
|
|
84
|
-
type SlackAuthorship =
|
|
85
|
-
| ((IconEmoji | IconURL) & Username)
|
|
86
|
-
| {
|
|
87
|
-
as_user: true;
|
|
88
|
-
icon_emoji?: never;
|
|
89
|
-
icon_url?: never;
|
|
90
|
-
username?: never;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
type SlackThreadReply = WithinThreadReply | BroadcastedThreadReply;
|
|
94
|
-
|
|
95
|
-
type SlackMessageBase = SlackMessageContents
|
|
96
|
-
& SlackThreadReply
|
|
97
|
-
& SlackAuthorship
|
|
98
|
-
& Parse
|
|
99
|
-
& LinkNames
|
|
100
|
-
& Unfurls
|
|
101
|
-
& ChatPostMessageMetadata
|
|
102
|
-
& {mrkdwn?: boolean};
|
|
103
|
-
|
|
104
|
-
type SlackMessage = SlackMessageBase & Omit<ChatPostMessageArguments, 'channel' | 'token'>;
|
|
105
|
-
|
|
106
|
-
type AnyFunction = (...parameters: unknown[]) => unknown;
|
|
107
|
-
|
|
108
|
-
type AnyConstructor = new (...parameters: unknown[]) => unknown;
|
|
109
|
-
|
|
110
|
-
type WithType = {
|
|
111
|
-
type?: string | AnyFunction | AnyConstructor;
|
|
112
|
-
};
|
|
113
|
-
type BElement = JSX.Element & WithType;
|
|
114
|
-
type Element = BElement;
|
|
115
|
-
type Child =
|
|
116
|
-
| string
|
|
117
|
-
| Element
|
|
118
|
-
| Child[]
|
|
119
|
-
| boolean
|
|
120
|
-
| undefined
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-types -- React children can be null.
|
|
122
|
-
| null;
|
|
123
|
-
|
|
124
|
-
export type { Block as B, Child as C, Element as E, InteractiveBlockElement as I, SlackMessage as S, InputBlockElement as a, BlockElement as b };
|