types

package
v1.0.0-rc27 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 0 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"`
	OnAction Command `json:"onAction,omitempty"`
}

type Command

type Command struct {
	Type CommandType `json:"type,omitempty"`
	Exit bool        `json:"exit,omitempty"`

	Text string `json:"text,omitempty"`
	Url  string `json:"url,omitempty"`

	Origin  string         `json:"origin,omitempty"`
	Command string         `json:"command,omitempty"`
	Params  map[string]any `json:"params,omitempty"`
}

type CommandMode

type CommandMode string
const (
	CommandModeView   CommandMode = "view"
	CommandModeNoView CommandMode = "no-view"
)

type CommandParam

type CommandParam struct {
	Name        string    `json:"name"`
	Type        ParamType `json:"type"`
	Optional    bool      `json:"optional,omitempty"`
	Description string    `json:"description,omitempty"`
}

type CommandSpec

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

type CommandType

type CommandType string
const (
	CommandTypeRun  CommandType = "run"
	CommandTypeOpen CommandType = "open"
	CommandTypeCopy CommandType = "copy"
)

type Detail

type Detail struct {
	Title    string   `json:"title,omitempty"`
	Actions  []Action `json:"actions,omitempty"`
	Text     string   `json:"text,omitempty"`
	Language string   `json:"language,omitempty"`
}
type DropDownItem struct {
	Title string `json:"title"`
	Value string `json:"value"`
}

type Form

type Form struct {
	Title string     `json:"title,omitempty"`
	Items []FormItem `json:"items,omitempty"`
}

type FormItem

type FormItem struct {
	Type        FormItemType `json:"type"`
	Name        string       `json:"name,omitempty"`
	Title       string       `json:"title"`
	Placeholder string       `json:"placeholder,omitempty"`
	Default     any          `json:"default,omitempty"`
	Optional    bool         `json:"optional,omitempty"`

	// Only for dropdown
	Items []DropDownItem `json:"items,omitempty"`

	// Only for checkbox
	Label string `json:"label,omitempty"`
}

type FormItemType

type FormItemType string
const (
	TextInput     FormItemType = "text"
	TextAreaInput FormItemType = "textarea"
	SelectInput   FormItemType = "select"
	CheckboxInput FormItemType = "checkbox"
)

type List

type List struct {
	Title string     `json:"title,omitempty"`
	Items []ListItem `json:"items"`
}

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"`
	Homepage    string        `json:"homepage,omitempty"`
	Root        string        `json:"root,omitempty"`
	Description string        `json:"description,omitempty"`
	Commands    []CommandSpec `json:"commands"`
}

type Metadata

type Metadata struct {
	Title string `json:"title,omitempty"`
	Text  string `json:"text,omitempty"`
	Url   string `json:"url,omitempty"`
}

type PageType

type PageType string
const (
	PageTypeList   PageType = "list"
	PageTypeForm   PageType = "form"
	PageTypeDetail PageType = "detail"
)

type ParamType

type ParamType string
const (
	ParamTypeString  ParamType = "string"
	ParamTypeBoolean ParamType = "boolean"
)

Jump to

Keyboard shortcuts

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