Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions packages/types/src/block-kit/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ export interface Block {
* {@link https://api.slack.com/reference/block-kit/blocks Blocks reference}.
*/
export type KnownBlock =
| ImageBlock
| ContextBlock
| ActionsBlock
| ContextBlock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical 🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure where else to add a new block! 😉

| DividerBlock
| SectionBlock
| InputBlock
| FileBlock
| HeaderBlock
| VideoBlock
| RichTextBlock;
| ImageBlock
| InputBlock
| MarkdownBlock
| RichTextBlock
| SectionBlock
| VideoBlock;

/**
* A helper union type of all known Blocks as well as the generic {@link Block} interface. A full list of known blocks
Expand Down Expand Up @@ -245,6 +246,23 @@ export interface InputBlock extends Block {
dispatch_action?: boolean;
}

/**
* @description This block can be used with AI apps when you expect a markdown response from an LLM that can get lost in
* translation rendering in Slack. Providing it in a markdown block leaves the translating to Slack to ensure your message
* appears as intended. Note that passing a single block may result in multiple blocks after translation.
* @see {@link https://api.slack.com/reference/block-kit/blocks#markdown Markdown block reference}
*/
export interface MarkdownBlock extends Block {
/**
* @description The type of block. For a markdown block, `type` is always `input`.
*/
type: 'markdown';
/**
* @description The standard markdown-formatted text. Limit 12,000 characters max.
*/
text: string;
}

/**
* A helper union type of all Block Elements that can be used in a {@link RichTextBlock}.
* @see {@link https://api.slack.com/reference/block-kit/blocks#rich_text Rich text block reference}.
Expand Down