import { Option } from "../../../deps.ts"import { StringIndexed, XOR } from "../helpers.ts"import { AckFn } from "../utilities.ts"
export interface SlackOptionsMiddlewareArgs< Source extends OptionsSource = OptionsSource,> { payload: OptionsRequest<Source> body: OptionsRequest<Source> options: OptionsRequest<Source> ack: OptionsAckFn<Source>}
export interface OptionsRequest<Source extends OptionsSource = OptionsSource> extends StringIndexed { value: string type: Source team: { id: string domain: string enterprise_id?: string enterprise_name?: string } | null channel?: { id: string name: string } user: { id: string name: string team_id?: string } token: string
name: Source extends "interactive_message" | "dialog_suggestion" ? string : never callback_id: Source extends "interactive_message" | "dialog_suggestion" ? string : never action_ts: Source extends "interactive_message" | "dialog_suggestion" ? string : never
message_ts: Source extends "interactive_message" ? string : never attachment_id: Source extends "interactive_message" ? string : never
api_app_id: Source extends "block_suggestion" ? string : never action_id: Source extends "block_suggestion" ? string : never block_id: Source extends "block_suggestion" ? string : never container: Source extends "block_suggestion" ? StringIndexed : never
app_unfurl?: any
is_enterprise_install?: boolean enterprise?: { id: string name: string }}
export type OptionsSource = | "interactive_message" | "dialog_suggestion" | "block_suggestion"
type OptionsAckFn<Source extends OptionsSource> = Source extends "block_suggestion" ? AckFn<XOR<BlockOptions, OptionGroups<BlockOptions>>> : Source extends "interactive_message" ? AckFn<XOR<MessageOptions, OptionGroups<MessageOptions>>> : AckFn<XOR<DialogOptions, OptionGroups<DialogOptions>>>
interface BlockOptions { options: Option[]}interface MessageOptions { options: { text: string value: string }[]}interface DialogOptions { options: { label: string value: string }[]}interface OptionGroups<Options> { option_groups: ({ label: string } & Options)[]}