Documentation
¶
Index ¶
- type Command
- type ExecutedMsg
- type Model
- func (m *Model) Hide()
- func (m Model) Init() tea.Cmd
- func (m Model) IsVisible() bool
- func (m *Model) RegisterCommand(name, description string, action func() tea.Cmd)
- func (m *Model) SetCommands(commands []Command)
- func (m *Model) SetMaxVisible(maxVisible int)
- func (m *Model) SetSize(width, height int)
- func (m *Model) Show()
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- func (m Model) WithStyles(styles Styles) Model
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutedMsg ¶
type ExecutedMsg struct {
Command string
Data interface{}
}
ExecutedMsg is sent when a command is executed
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the command palette state
func (*Model) RegisterCommand ¶
RegisterCommand adds a new command to the palette
func (*Model) SetCommands ¶ added in v0.1.0
SetCommands replaces all commands in the palette.
func (*Model) SetMaxVisible ¶ added in v0.1.0
SetMaxVisible sets the maximum number of commands rendered in the list.
func (Model) WithStyles ¶
WithStyles sets custom styles for the command palette
type Styles ¶
type Styles struct {
Palette lipgloss.Style
Header lipgloss.Style
Query lipgloss.Style
Command lipgloss.Style
SelectedCommand lipgloss.Style
CommandName lipgloss.Style
CommandDescription lipgloss.Style
Help lipgloss.Style
}
Styles defines the styling for the command palette
func DefaultStyles ¶
func DefaultStyles() Styles
DefaultStyles returns the default styles for the command palette
Click to show internal directories.
Click to hide internal directories.