diff --git a/src/types/options/index.ts b/src/types/options/index.ts index eefe54f84..ab6442684 100644 --- a/src/types/options/index.ts +++ b/src/types/options/index.ts @@ -13,18 +13,20 @@ export interface SlackOptionsMiddlewareArgs; } +export type SlackOptions = BlockSuggestion | InteractiveMessageSuggestion | DialogSuggestion; + +// TODO: why call this 'source'? shouldn't it be Type, since it is just the type value? /** * All sources from which Slack sends options requests. */ -export type OptionsSource = 'interactive_message' | 'dialog_suggestion' | 'block_suggestion'; - -export type SlackOptions = BlockSuggestion | InteractiveMessageSuggestion | DialogSuggestion; +export type OptionsSource = SlackOptions['type']; export interface BasicOptionsPayload { type: Type; value: string; } +// TODO: Is this useful? Events have something similar export type OptionsPayloadFromType = KnownOptionsPayloadFromType extends never ? BasicOptionsPayload : KnownOptionsPayloadFromType; @@ -145,8 +147,8 @@ export interface DialogSuggestion extends StringIndexed { type OptionsAckFn = Source extends 'block_suggestion' ? AckFn>> : Source extends 'interactive_message' - ? AckFn>> - : AckFn>>; + ? AckFn>> + : AckFn>>; // TODO: why are the next two interfaces identical? export interface BlockOptions {