UNPKG

slack-block-builder

Version:

Maintainable code for interactive Slack messages, modals, home tabs, and workflow steps. A must-have for the Slack Block Kit framework.

114 lines (113 loc) 3.75 kB
import { SurfaceType, BlockType, ElementType } from '../constants'; import type { ObjectLiteral } from '../types'; import type { PlainTextObject } from '../objects'; export declare enum Param { actionId = "action_id", blocks = "blocks", blockId = "block_id", maxSelectedItems = "max_selected_items", title = "title", text = "text", confirm = "confirm", deny = "deny", style = "style", danger = "danger", label = "label", options = "options", value = "value", description = "description", url = "url", elements = "elements", externalId = "external_id", imageUrl = "image_url", altText = "alt_text", element = "element", hint = "hint", optional = "optional", fields = "fields", accessory = "accessory", initialChannels = "initial_channels", initialChannel = "initial_channel", responseUrlEnabled = "response_url_enabled", initialOptions = "initial_options", initialConversations = "initial_conversations", defaultToCurrentConversation = "default_to_current_conversation", filter = "filter", initialConversation = "initial_conversation", initialDate = "initial_date", initialDateTime = "initial_date_time", isDecimalAllowed = "is_decimal_allowed", minQueryLength = "min_query_length", initialOption = "initial_option", optionGroups = "option_groups", placeholder = "placeholder", initialValue = "initial_value", multiline = "multiline", minLength = "min_length", maxLength = "max_length", initialUsers = "initial_users", initialUser = "initial_user", channel = "channel", close = "close", submit = "submit", clearOnClose = "clear_on_close", notifyOnClose = "notify_on_close", privateMetaData = "private_metadata", callbackId = "callback_id", asUser = "as_user", ts = "ts", threadTs = "thread_ts", replaceOriginal = "replace_original", deleteOriginal = "delete_original", responseType = "response_type", postAt = "post_at", color = "color", fallback = "fallback", attachments = "attachments", dispatchAction = "dispatch_action", dispatchActionConfig = "dispatch_action_config", initialTime = "initial_time", mrkdwn = "mrkdwn", submitDisabled = "submit_disabled", type = "type", focusOnLoad = "focus_on_load", accessibilityLabel = "accessibility_label", authorName = "author_name", providerIconUrl = "provider_icon_url", providerName = "provider_name", titleUrl = "title_url", thumbnailUrl = "thumbnail_url", videoUrl = "video_url", minValue = "min_value", maxValue = "max_value" } export declare class SlackDto implements ObjectLiteral { constructor(params: ObjectLiteral); static mapParam(param: string): string; } export declare class SlackMessageDto extends SlackDto { readonly text: string; readonly channel: string; readonly blocks?: SlackBlockDto[]; readonly attachments?: SlackDto[]; } export declare class SlackHomeTabDto extends SlackDto { readonly type = SurfaceType.HomeTab; readonly blocks: SlackBlockDto[]; } export declare class SlackModalDto extends SlackDto { readonly type = SurfaceType.Modal; readonly title: PlainTextObject; readonly blocks: SlackBlockDto[]; } export declare class SlackWorkflowStepDto extends SlackDto { readonly type = SurfaceType.WorkflowStep; readonly blocks: SlackBlockDto[]; } export declare type SlackViewDto = SlackModalDto | SlackWorkflowStepDto | SlackHomeTabDto; export declare class SlackBlockDto extends SlackDto { readonly type: BlockType; } export declare class SlackElementDto extends SlackDto { readonly type: ElementType; }