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

Add Timepicker to @slack/types #1226

Merged
merged 2 commits into from
May 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 19 additions & 4 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Reusable shapes for argument values
*/
Expand Down Expand Up @@ -220,6 +219,13 @@ export interface Datepicker extends Action {
confirm?: Confirm;
}

export interface Timepicker extends Action {
type: 'timepicker';
initial_time?: string;
placeholder?: PlainTextElement;
confirm?: Confirm;
}

export interface RadioButtons extends Action {
type: 'radio_buttons';
initial_option?: Option;
Expand Down Expand Up @@ -274,7 +280,7 @@ export interface ContextBlock extends Block {

export interface ActionsBlock extends Block {
type: 'actions';
elements: (Button | Overflow | Datepicker | Select | RadioButtons | Checkboxes | Action)[];
elements: (Button | Overflow | Datepicker | Timepicker | Select | RadioButtons | Checkboxes | Action)[];
}

export interface DividerBlock extends Block {
Expand All @@ -285,7 +291,16 @@ export interface SectionBlock extends Block {
type: 'section';
text?: PlainTextElement | MrkdwnElement; // either this or fields must be defined
fields?: (PlainTextElement | MrkdwnElement)[]; // either this or text must be defined
accessory?: Button | Overflow | Datepicker | Select | MultiSelect | Action | ImageElement | RadioButtons | Checkboxes;
accessory?: Button
| Overflow
| Datepicker
| Timepicker
| Select
| MultiSelect
| Action
| ImageElement
| RadioButtons
| Checkboxes;
}

export interface FileBlock extends Block {
Expand All @@ -304,7 +319,7 @@ export interface InputBlock extends Block {
label: PlainTextElement;
hint?: PlainTextElement;
optional?: boolean;
element: Select | MultiSelect | Datepicker | PlainTextInput | RadioButtons | Checkboxes;
element: Select | MultiSelect | Datepicker | Timepicker | PlainTextInput | RadioButtons | Checkboxes;
dispatch_action?: boolean;
}

Expand Down