slackblock 2.0.0-beta.1 → 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.
@@ -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 };