Skip to content

Commit

Permalink
Merge pull request #1226 from raycharius/add-time-picker
Browse files Browse the repository at this point in the history
Add Timepicker to @slack/types
  • Loading branch information
stevengill committed May 6, 2021
2 parents a576184 + 47c1a4e commit a37c8cd
Showing 1 changed file with 19 additions and 4 deletions.
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

0 comments on commit a37c8cd

Please sign in to comment.