GoSetup-bubble/types/msg.go

60 lines
2.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package types
import tea "github.com/charmbracelet/bubbletea"
// SelectedAppMsg сообщение выбора приложения из списка приложений
type SelectedAppMsg struct {
App PackageApplication //Объект выбранного приложения
}
// BackToListMsg сообщение перехода к списку приложений
type BackToListMsg struct{}
// NextSectionMsg сообщение перехода на следующую секцию
type NextSectionMsg struct{}
// SugarMsg сообщение о возможной необходимости обновить форму
type SugarMsg struct {
VariableName string //Имя переменной присвоенной измененному полю
FieldName string //Имя измененного поля
Focus int //Старый фокус формы
}
// ShowModalMsg сообщение о показе модального окна
type ShowModalMsg struct {
Type ModalType //Тип модального окна
Title string //Заголовок модального окна
Message string //Сообщение модального окна
ModalButtons []ModalButton //Кнопки модального окна
OnResult func(result any) tea.Cmd //Функция для выполнения
}
// ModalButton структура кнопки модального окна
type ModalButton struct {
Text string //Текст кнопки
Value any //Значение кнопки
}
// CloseModalMsg сообщение о закрытии модального окна
type CloseModalMsg struct{}
// ViewportScrollMsg сообщение прокрутки видимой области формы
type ViewportScrollMsg struct {
Direction string //Направление прокрутки
}
type ActionProgressMsg struct {
ActionName string
Status string
Message string
}
// ActionsCompleteMsg сообщение результата выполнения действий
type ActionsCompleteMsg struct {
Success bool //Статус выполнения действий
Log []string //Массив логов
}
// ActionClearLogsMsg сообщение очистки окна логов действий
type ActionClearLogsMsg struct {
}