type SlackButtonStyle = "danger" | "default" | "primary"; type SlackTextStyle = "bold" | "muted" | "plain"; type SlackTableAlignment = "center" | "left" | "right"; interface SlackCardElement { children: SlackCardChild[]; imageUrl?: string; subtitle?: string; title?: string; type: "card"; } type SlackCardChild = SlackActionsElement | SlackDividerElement | SlackFieldsElement | SlackImageElement | SlackLinkElement | SlackSectionElement | SlackTableElement | SlackTextElement; interface SlackTextElement { content: string; style?: SlackTextStyle; type: "text"; } interface SlackImageElement { alt?: string; type: "image"; url: string; } interface SlackDividerElement { type: "divider"; } interface SlackActionsElement { children: (SlackButtonElement | SlackLinkButtonElement | SlackRadioSelectElement | SlackSelectElement)[]; type: "actions"; } interface SlackButtonElement { callbackUrl?: string; disabled?: boolean; id: string; label: string; style?: SlackButtonStyle; type: "button"; value?: string; } interface SlackLinkButtonElement { label: string; style?: SlackButtonStyle; type: "link-button"; url: string; } interface SlackSelectOptionElement { description?: string; label: string; value: string; } interface SlackSelectElement { id: string; initialOption?: string; label: string; options: SlackSelectOptionElement[]; placeholder?: string; type: "select"; } interface SlackRadioSelectElement { id: string; initialOption?: string; label: string; options: SlackSelectOptionElement[]; type: "radio_select"; } interface SlackSectionElement { children: SlackCardChild[]; type: "section"; } interface SlackLinkElement { label: string; type: "link"; url: string; } interface SlackFieldElement { label: string; type: "field"; value: string; } interface SlackFieldsElement { children: SlackFieldElement[]; type: "fields"; } interface SlackTableElement { align?: SlackTableAlignment[]; headers: string[]; rows: string[][]; type: "table"; } interface SlackTextObject { emoji?: boolean; text: string; type: "mrkdwn" | "plain_text"; } interface SlackBlock { block_id?: string; type: string; [key: string]: unknown; } interface SlackBlocksOptions { convertEmoji?: (text: string) => string; maxBlocks?: number; } declare class SlackBlockError extends Error { constructor(message: string); } declare const SLACK_INPUT_ACTION_PREFIX = "input:"; declare const SLACK_FREEFORM_ACTION_PREFIX = "input-freeform:"; declare const SLACK_FREEFORM_CALLBACK_ID = "input-freeform-submit"; declare const SLACK_FREEFORM_BLOCK_ID = "input-freeform-block"; declare const SLACK_FREEFORM_ACTION_ID = "input-freeform-text"; interface SlackInputOption { description?: string; id: string; label: string; style?: SlackButtonStyle; } interface SlackInputRequest { allowFreeform?: boolean; display?: "buttons" | "radio" | "select"; options?: readonly SlackInputOption[]; prompt: string; requestId: string; } interface SlackInputAction { actionId: string; selectedOptionValue?: string; value?: string; } interface SlackInputResponse { optionId?: string; requestId: string; } interface SlackFreeformViewOptions { metadata: unknown; prompt?: string; title?: string; } declare function inputRequestToSlackBlocks(request: SlackInputRequest): SlackBlock[]; declare function parseSlackInputResponse(action: SlackInputAction): SlackInputResponse | null; declare function buildSlackFreeformView(options: SlackFreeformViewOptions): Record; declare function parseSlackFreeformValue(values: readonly { actionId: string; blockId: string; value?: string; }[]): string | undefined; declare function answeredSlackInputBlocks(input: { answer: string; promptBlock?: unknown; userId?: string; }): SlackBlock[]; declare function cardToSlackBlocks(card: SlackCardElement, options?: SlackBlocksOptions): SlackBlock[]; declare const cardToBlockKit: typeof cardToSlackBlocks; declare function cardToSlackFallbackText(card: SlackCardElement, options?: Pick): string; declare const cardToFallbackText: typeof cardToSlackFallbackText; declare function convertSlackEmojiPlaceholders(text: string): string; export { SLACK_FREEFORM_ACTION_ID, SLACK_FREEFORM_ACTION_PREFIX, SLACK_FREEFORM_BLOCK_ID, SLACK_FREEFORM_CALLBACK_ID, SLACK_INPUT_ACTION_PREFIX, type SlackActionsElement, type SlackBlock, SlackBlockError, type SlackBlocksOptions, type SlackButtonElement, type SlackButtonStyle, type SlackCardChild, type SlackCardElement, type SlackDividerElement, type SlackFieldElement, type SlackFieldsElement, type SlackFreeformViewOptions, type SlackImageElement, type SlackInputAction, type SlackInputOption, type SlackInputRequest, type SlackInputResponse, type SlackLinkButtonElement, type SlackLinkElement, type SlackRadioSelectElement, type SlackSectionElement, type SlackSelectElement, type SlackSelectOptionElement, type SlackTableAlignment, type SlackTableElement, type SlackTextElement, type SlackTextObject, type SlackTextStyle, answeredSlackInputBlocks, buildSlackFreeformView, cardToBlockKit, cardToFallbackText, cardToSlackBlocks, cardToSlackFallbackText, convertSlackEmojiPlaceholders, inputRequestToSlackBlocks, parseSlackFreeformValue, parseSlackInputResponse };