type SlackHeaderValue = readonly string[] | string | null | undefined; type SlackHeaders = Headers | Iterable | Record; type SlackWebhookVerifier = (request: Request, body: string) => Promise | unknown; interface SlackVerifyOptions { maxSkewSeconds?: number; now?: () => number; signingSecret?: string; webhookVerifier?: SlackWebhookVerifier; } interface SlackParseOptions { contentType?: string | null; headers?: SlackHeaders; } interface SlackReadOptions extends SlackParseOptions, SlackVerifyOptions { } interface SlackRetry { num: number; reason?: string; } interface SlackContinuation { channelId: string; enterpriseId?: string; teamId?: string; threadTs: string; } interface SlackUser { id: string; name?: string; teamId?: string; username?: string; } interface SlackFile { downloadUrl?: string; filetype?: string; id: string; mimeType?: string; name?: string; raw: Record; size?: number; title?: string; type: "audio" | "file" | "image" | "video"; url?: string; } type SlackWebhookPayload = SlackAppMentionPayload | SlackBlockActionsPayload | SlackBlockSuggestionPayload | SlackDirectMessagePayload | SlackSlashCommandPayload | SlackUnsupportedPayload | SlackUrlVerificationPayload | SlackViewClosedPayload | SlackViewSubmissionPayload; interface SlackUrlVerificationPayload { challenge: string; kind: "url_verification"; raw: Record; retry?: SlackRetry; } interface SlackEventBasePayload { apiAppId?: string; channelId: string; continuation: SlackContinuation; enterpriseId?: string; eventId?: string; eventTime?: number; files?: SlackFile[]; isExtSharedChannel?: boolean; raw: Record; retry?: SlackRetry; teamId?: string; text: string; threadTs: string; ts: string; userId?: string; } interface SlackAppMentionPayload extends SlackEventBasePayload { eventType: "app_mention"; kind: "app_mention"; } interface SlackDirectMessagePayload extends SlackEventBasePayload { botId?: string; eventType: "message"; kind: "direct_message"; subtype?: string; } interface SlackSlashCommandPayload { channelId: string; channelName?: string; command: string; enterpriseId?: string; isEnterpriseInstall: boolean; kind: "slash_command"; raw: Record; responseUrl?: string; retry?: SlackRetry; teamId?: string; text: string; triggerId?: string; userId: string; userName?: string; } interface SlackAction { actionId: string; blockId?: string; label?: string; raw: Record; selectedOptionLabel?: string; selectedOptionValue?: string; type: string; user?: SlackUser; value?: string; } interface SlackBlockActionsPayload { actions: SlackAction[]; channelId?: string; continuation?: SlackContinuation; enterpriseId?: string; isEnterpriseInstall?: boolean; kind: "block_actions"; messageBlocks?: unknown[]; messagePromptBlock?: unknown; messagePromptText?: string; messageTs?: string; raw: Record; responseUrl?: string; retry?: SlackRetry; teamId?: string; threadTs?: string; triggerId?: string; user?: SlackUser; userId: string; userName?: string; } interface SlackBlockSuggestionPayload { actionId: string; blockId: string; channelId?: string; enterpriseId?: string; kind: "block_suggestion"; raw: Record; retry?: SlackRetry; teamId?: string; userId: string; value: string; } interface SlackViewSubmissionPayload { callbackId?: string; enterpriseId?: string; kind: "view_submission"; privateMetadata?: string; raw: Record; responseUrls?: unknown[]; retry?: SlackRetry; teamId?: string; user?: SlackUser; userId: string; values?: SlackViewStateValue[]; view: Record; } interface SlackViewClosedPayload { enterpriseId?: string; kind: "view_closed"; raw: Record; retry?: SlackRetry; teamId?: string; user?: SlackUser; userId: string; view: Record; } interface SlackViewStateValue { actionId: string; blockId: string; raw: Record; selectedOptionLabel?: string; selectedOptionValue?: string; type?: string; value?: string; } interface SlackUnsupportedPayload { kind: "unsupported"; raw: unknown; retry?: SlackRetry; type: string; } declare class SlackWebhookError extends Error { constructor(message: string); } declare class SlackWebhookVerificationError extends SlackWebhookError { constructor(message: string); } declare class SlackWebhookParseError extends SlackWebhookError { constructor(message: string); } export { type SlackAction as S, type SlackAppMentionPayload as a, type SlackBlockActionsPayload as b, type SlackBlockSuggestionPayload as c, type SlackContinuation as d, type SlackDirectMessagePayload as e, type SlackEventBasePayload as f, type SlackFile as g, type SlackHeaderValue as h, type SlackHeaders as i, type SlackParseOptions as j, type SlackReadOptions as k, type SlackRetry as l, type SlackSlashCommandPayload as m, type SlackUnsupportedPayload as n, type SlackUrlVerificationPayload as o, type SlackUser as p, type SlackVerifyOptions as q, type SlackViewClosedPayload as r, type SlackViewStateValue as s, type SlackViewSubmissionPayload as t, SlackWebhookError as u, SlackWebhookParseError as v, type SlackWebhookPayload as w, SlackWebhookVerificationError as x, type SlackWebhookVerifier as y };