import { KnownBlock } from '@slack/types'; interface ParsingOptions { lists?: ListOptions; } interface ListOptions { checkboxPrefix?: (checked: boolean) => string; } interface VideoBlock { type: 'video'; alt_text: string; title: { type: 'plain_text'; text: string; emoji?: boolean; }; thumbnail_url: string; video_url: string; author_name?: string; block_id?: string; description?: { type: 'plain_text'; text: string; emoji?: boolean; }; provider_icon_url?: string; provider_name?: string; title_url?: string; } interface FileBlock { type: 'file'; external_id: string; source: 'remote'; block_id?: string; } interface TableBlock { type: 'table'; block_id?: string; rows: TableRow[]; column_settings?: ColumnSetting[]; } type TableRow = TableCell[]; interface TableCell { type: 'raw_text' | 'rich_text'; text?: string; elements?: RichTextElement[]; } interface ColumnSetting { align?: 'left' | 'center' | 'right'; is_wrapped?: boolean; } interface RichTextElement { type: 'rich_text_section'; elements: RichTextSectionElement[]; } interface RichTextSectionElement { type: 'text' | 'link' | 'emoji'; text: string; style?: { bold?: boolean; italic?: boolean; strike?: boolean; code?: boolean; }; url?: string; name?: string; } interface RichTextBlock { type: 'rich_text'; block_id?: string; elements: (RichTextListElement | RichTextElement | RichTextPreformattedElement | RichTextQuoteElement)[]; } interface RichTextListElement { type: 'rich_text_list'; style: 'bullet' | 'ordered'; indent?: number; offset?: number; border?: number; elements: RichTextElement[]; } interface RichTextPreformattedElement { type: 'rich_text_preformatted'; elements: RichTextSectionElement[]; border?: number; } interface RichTextQuoteElement { type: 'rich_text_quote'; elements: RichTextSectionElement[]; border?: number; } /** * Parses Markdown content into Slack BlockKit Blocks. * - Supports headings (all Markdown heading levels are treated as the single Slack header block) * - Supports numbered lists, bulleted lists, to-do lists * - Supports italics, bold, strikethrough, inline code, hyperlinks * - Supports images * - Supports thematic breaks / dividers * - Supports nested lists and blockquotes with rich content * - Supports native table blocks with rich text formatting and column alignment * * Supports GitHub-flavoured Markdown. * * Enforces Slack API limits: * - Maximum 50 blocks per message * - Maximum 3000 characters per section block * - Maximum 150 characters per header block * - Text truncation handles multi-byte characters safely * * @param body any Markdown or GFM content * @param options options to configure the parser * @throws {ValidationError} if input is invalid or exceeds limits * @throws {BlockLimitError} if block count exceeds maximum * @throws {ParseError} if parsing fails */ declare function markdownToBlocks(body: string, options?: ParsingOptions): Promise<(KnownBlock | TableBlock | VideoBlock | FileBlock | RichTextBlock)[]>; export { markdownToBlocks };