GoSetup-bubble/setup/fields/fieldModel.go

14 lines
855 B
Go
Raw 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 fields
import tea "github.com/charmbracelet/bubbletea"
type FieldModel interface {
Init() tea.Cmd //Метод инициализации поля
Update(msg tea.Msg) (FieldModel, tea.Cmd) //Метод отслеживания событий связанных с моделью
View() string //Метод отрисовки модели
Focus() //Метод установки фокуса
Blur() //Метод удаления фокуса
CaptureKeys() bool //Метод проверяющий захват событий
GetLabel() string //Получить имя поля
GetValue() interface{} //Получить значение поля
}