Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding type for plain_text_input action elements #706

Merged
merged 2 commits into from
Mar 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adding type for plain_text_input action elements
  • Loading branch information
br-tim-ray committed Dec 9, 2020
commit a599e848d56e538a63689ce393312cd90ac6f0d7
11 changes: 10 additions & 1 deletion src/types/actions/block-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export type BlockElementAction =
| OverflowAction
| DatepickerAction
| RadioButtonsAction
| CheckboxesAction;
| CheckboxesAction
| PlainTextInputAction;

/**
* Any action from Slack's interactive elements
Expand Down Expand Up @@ -196,6 +197,13 @@ export interface CheckboxesAction extends BasicElementAction<'checkboxes'> {
confirm?: Confirmation;
}

/**
* An action from a plain_text_input element (must use dispatch_action: true)
*/
export interface PlainTextInputAction extends BasicElementAction<'plain_text_input'> {
value: string;
}

/**
* A Slack Block Kit element action wrapped in the standard metadata.
*
Expand Down Expand Up @@ -259,3 +267,4 @@ export type BlockOverflowAction = BlockAction<OverflowAction>;
export type BlockDatepickerAction = BlockAction<DatepickerAction>;
export type BlockRadioButtonsAction = BlockAction<RadioButtonsAction>;
export type BlockCheckboxesAction = BlockAction<CheckboxesAction>;
export type BlockPlainTextInputAction = BlockAction<PlainTextInputAction>;