Documentation
¶
Index ¶
Constants ¶
View Source
const ( CopyAction = "copy" OpenAction = "open" PushAction = "push" RunAction = "run" ExitAction = "exit" ReloadAction = "reload" )
Variables ¶
View Source
var TypeScript string
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Title string `json:"title,omitempty" yaml:"title,omitempty"`
Type ActionType `json:"type" yaml:"type"`
Key string `json:"key,omitempty" yaml:"key,omitempty"`
Inputs []Input `json:"inputs,omitempty" yaml:"inputs,omitempty"`
// copy
Text string `json:"text,omitempty" yaml:"text,omitempty"`
// open
Target string `json:"target,omitempty" yaml:"target,omitempty"`
// push
Page string `json:"page,omitempty" yaml:"page,omitempty"`
// run
Command *Command `json:"command,omitempty" yaml:"command,omitempty"`
Confirm bool `json:"confirm,omitempty" yaml:"confirm,omitempty"`
OnSuccess OnSuccessType `json:"onSuccess,omitempty" yaml:"onSuccess,omitempty"`
}
type ActionType ¶
type ActionType string
type Command ¶ added in v0.9.0
type Command struct {
Args []string `json:"args" yaml:"args"`
Input string `json:"input,omitempty" yaml:"input,omitempty"`
Dir string `json:"dir,omitempty" yaml:"dir,omitempty"`
}
func (*Command) UnmarshalJSON ¶ added in v0.9.0
func (*Command) UnmarshalYAML ¶ added in v0.9.0
type DropDownItem ¶ added in v0.9.0
type FormInputType ¶
type FormInputType string
const ( TextFieldInput FormInputType = "textfield" TextAreaInput FormInputType = "textarea" DropDownInput FormInputType = "dropdown" CheckboxInput FormInputType = "checkbox" )
type Input ¶ added in v0.7.0
type Input struct {
Name string `json:"name" yaml:"name"`
Type FormInputType `json:"type" yaml:"type"`
Title string `json:"title" yaml:"title"`
Placeholder string `json:"placeholder,omitempty" yaml:"placeholder,omitempty"`
Default any `json:"default,omitempty" yaml:"default,omitempty"`
// Only for dropdown
Items []DropDownItem `json:"items,omitempty" yaml:"items,omitempty"`
// Only for checkbox
Label string `json:"label,omitempty" yaml:"label,omitempty"`
TrueSubstitution string `json:"trueSubstitution,omitempty" yaml:"trueSubstitution,omitempty"`
FalseSubstitution string `json:"falseSubstitution,omitempty" yaml:"falseSubstitution,omitempty"`
}
type ListItem ¶
type ListItem struct {
Id string `json:"id,omitempty" yaml:"id,omitempty"`
Title string `json:"title" yaml:"title"`
Subtitle string `json:"subtitle,omitempty" yaml:"subtitle,omitempty"`
Preview *Preview `json:"preview,omitempty" yaml:"preview,omitempty"`
Accessories []string `json:"accessories,omitempty" yaml:"accessories,omitempty"`
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty"`
}
type OnSuccessType ¶
type OnSuccessType string
var ( OpenOnSuccess OnSuccessType = "open" PushOnSuccess OnSuccessType = "push" ExitOnSuccess OnSuccessType = "exit" ReloadOnSuccess OnSuccessType = "reload" CopyOnSuccess OnSuccessType = "copy" )
type Page ¶
type Page struct {
Type PageType `json:"type" yaml:"type"`
Title string `json:"title,omitempty" yaml:"title,omitempty"`
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty"`
// Form page
SubmitAction *Action `json:"submitAction,omitempty" yaml:"submitAction,omitempty"`
// Detail page
Preview *Preview `json:"preview,omitempty" yaml:"preview,omitempty"`
// List page
ShowPreview bool `json:"showPreview,omitempty" yaml:"showPreview,omitempty"`
EmptyView *struct {
Text string `json:"text,omitempty" yaml:"text,omitempty"`
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty"`
} `json:"emptyView,omitempty" yaml:"emptyView,omitempty"`
Items []ListItem `json:"items,omitempty" yaml:"items,omitempty"`
}
type Preview ¶ added in v0.9.0
type Preview struct {
Language string `json:"language,omitempty" yaml:"language,omitempty"`
Text string `json:"text,omitempty" yaml:"text,omitempty"`
Command *Command `json:"command,omitempty" yaml:"command,omitempty"`
}
func (*Preview) UnmarshalJSON ¶ added in v0.9.5
func (*Preview) UnmarshalYAML ¶ added in v0.9.5
Click to show internal directories.
Click to hide internal directories.