types

package
v1.0.0-rc.81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Title string     `json:"title,omitempty"`
	Key   string     `json:"key,omitempty"`
	Type  ActionType `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]Param `json:"params,omitempty"`

	Dir string `json:"dir,omitempty"`
}

type ActionType

type ActionType string
const (
	ActionTypeRun    ActionType = "run"
	ActionTypeOpen   ActionType = "open"
	ActionTypeCopy   ActionType = "copy"
	ActionTypeReload ActionType = "reload"
	ActionTypeEdit   ActionType = "edit"
	ActionTypeExec   ActionType = "exec"
	ActionTypeExit   ActionType = "exit"
)

type Application

type Application struct {
	Macos string `json:"macos,omitempty"`
	Linux string `json:"linux,omitempty"`
}

type CommandMode

type CommandMode string
const (
	CommandModeList   CommandMode = "list"
	CommandModeDetail CommandMode = "detail"
	CommandModeTTY    CommandMode = "tty"
	CommandModeSilent CommandMode = "silent"
)

type CommandSpec

type CommandSpec struct {
	Name   string      `json:"name"`
	Title  string      `json:"title"`
	Hidden bool        `json:"hidden,omitempty"`
	Inputs []Input     `json:"params,omitempty"`
	Mode   CommandMode `json:"mode,omitempty"`
}

type Detail

type Detail struct {
	Actions []Action `json:"actions,omitempty"`
	Format  Format   `json:"format,omitempty"`
	Text    string   `json:"text,omitempty"`
}

type Format

type Format string
const (
	MarkdownFormat Format = "markdown"
	ANSIFormat     Format = "ansi"
	TemplateFormat Format = "template"
)

type Input

type Input struct {
	Type        InputType `json:"type"`
	Name        string    `json:"name"`
	Title       string    `json:"title"`
	Required    bool      `json:"required,omitempty"`
	Default     any       `json:"default,omitempty"`
	Placeholder string    `json:"placeholder,omitempty"`
	Label       string    `json:"label,omitempty"`
}

type InputType

type InputType string
const (
	InputText     InputType = "text"
	InputTextArea InputType = "textarea"
	InputPassword InputType = "password"
	InputCheckbox InputType = "checkbox"
	InputNumber   InputType = "number"
)

type List

type List struct {
	Items     []ListItem `json:"items,omitempty"`
	Dynamic   bool       `json:"dynamic,omitempty"`
	EmptyText string     `json:"emptyText,omitempty"`
	Actions   []Action   `json:"actions,omitempty"`
}

type ListItem

type ListItem struct {
	Id          string   `json:"id,omitempty"`
	Title       string   `json:"title"`
	Subtitle    string   `json:"subtitle,omitempty"`
	Accessories []string `json:"accessories,omitempty"`
	Actions     []Action `json:"actions,omitempty"`
}

type Manifest

type Manifest struct {
	Title        string        `json:"title"`
	Platforms    []Platfom     `json:"platforms,omitempty"`
	Description  string        `json:"description,omitempty"`
	Requirements []Requirement `json:"requirements,omitempty"`
	Items        []RootItem    `json:"items,omitempty"`
	Commands     []CommandSpec `json:"commands"`
}

type Param

type Param struct {
	Value    any  `json:"value,omitempty"`
	Default  any  `json:"default,omitempty"`
	Required bool `json:"required,omitempty"`
}

func (Param) MarshalJSON

func (p Param) MarshalJSON() ([]byte, error)

func (*Param) UnmarshalJSON

func (p *Param) UnmarshalJSON(bts []byte) error

type Payload

type Payload struct {
	Command     string         `json:"command"`
	Preferences Preferences    `json:"preferences"`
	Params      map[string]any `json:"params"`
	Cwd         string         `json:"cwd"`
	Query       string         `json:"query,omitempty"`
}

type Platfom

type Platfom string
const (
	PlatformLinux Platfom = "linux"
	PlatformMac   Platfom = "macos"
)

type Preferences

type Preferences map[string]any

type Requirement

type Requirement struct {
	Name string `json:"name"`
	Link string `json:"link,omitempty"`
}

type RootItem

type RootItem struct {
	Title   string           `json:"title,omitempty"`
	Command string           `json:"command"`
	Params  map[string]Param `json:"params,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL