-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblocks.go
More file actions
44 lines (39 loc) · 1.08 KB
/
Copy pathblocks.go
File metadata and controls
44 lines (39 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package spanner
// BlockUI allows the creation of Slack blocks in a message or modal.
type BlockUI interface {
NonInteractiveBlockUI
InteractiveBlockUI
}
type NonInteractiveBlockUI interface {
Header(message string)
PlainText(text string)
Markdown(text string)
}
type InteractiveBlockUI interface {
TextInput(label string, hint string, placeholder string) string
MultilineTextInput(label string, hint string, placeholder string) string
Divider()
Select(title string, options []Option) string
MultipleSelect(title string, options []Option) []string
Button(label string) bool
}
// Option defines an option for select or checkbox blocks.
type Option struct {
Label string
Description string
Value string
}
// Options is a convenience function to create a set of options from
// a list of strings.
// The strings are used as both the label and value.
// The descriptions are left empty.
func Options(options ...string) []Option {
out := make([]Option, len(options))
for i, option := range options {
out[i] = Option{
Label: option,
Value: option,
}
}
return out
}