Documentation
¶
Index ¶
- type Action
- type Application
- type Command
- type CommandInput
- type CommandMode
- type CommandRef
- type CommandSpec
- type CommandType
- type Detail
- type DropDownItem
- type Field
- type Form
- type Input
- type InputType
- type List
- type ListItem
- type Manifest
- type Metadata
- type Param
- type ParamType
- type View
- type ViewType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Command ¶
type Command struct {
Type CommandType `json:"type,omitempty"`
Text string `json:"text,omitempty"`
App Application `json:"app,omitempty"`
Target string `json:"target,omitempty"`
Exit bool `json:"exit,omitempty"`
Reload bool `json:"reload,omitempty"`
Extension string `json:"extension,omitempty"`
Command string `json:"command,omitempty"`
Params map[string]any `json:"params,omitempty"`
}
TODO: move distinct types to their own structs
type CommandInput ¶
type CommandMode ¶
type CommandMode string
const ( CommandModeView CommandMode = "view" CommandModeNoView CommandMode = "no-view" CommandModeTTY CommandMode = "tty" )
type CommandRef ¶
type CommandSpec ¶
type CommandSpec struct {
Name string `json:"name"`
Title string `json:"title"`
Hidden bool `json:"hidden,omitempty"`
Params []Param `json:"params,omitempty"`
Mode CommandMode `json:"mode,omitempty"`
}
type CommandType ¶
type CommandType string
const ( CommandTypeRun CommandType = "run" CommandTypeOpen CommandType = "open" CommandTypeCopy CommandType = "copy" CommandTypeReload CommandType = "reload" CommandTypeExit CommandType = "exit" CommandTypePop CommandType = "pop" )
type Detail ¶
type Detail struct {
Title string `json:"title,omitempty"`
Actions []Action `json:"actions,omitempty"`
Markdown string `json:"markdown,omitempty"`
}
func (Detail) MarshalJSON ¶
type DropDownItem ¶
type Form ¶
func (Form) MarshalJSON ¶
type Input ¶
type Input struct {
Type InputType `json:"type"`
Placeholder string `json:"placeholder,omitempty"`
Default any `json:"default,omitempty"`
// Only for dropdown
Choices []DropDownItem `json:"choices,omitempty"`
// Only for checkbox
Label string `json:"label,omitempty"`
}
TODO: move distinct types to their own structs
type List ¶
type List struct {
Title string `json:"title,omitempty"`
Items []ListItem `json:"items,omitempty"`
Dynamic bool `json:"dynamic,omitempty"`
EmptyText string `json:"emptyText,omitempty"`
Actions []Action `json:"actions,omitempty"`
}
func (List) MarshalJSON ¶
type Manifest ¶
type Manifest struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
Commands []CommandSpec `json:"commands"`
}
Click to show internal directories.
Click to hide internal directories.