mainui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountProvider

type AccountProvider interface {
	GetAllAccounts() ([]save.Account, error)
	UpdateTokensFor(id, accessToken, refreshToken string) error
	GetAccountBy(id string) (save.Account, error)
}

type AppKeyMap

type AppKeyMap struct {
	Quit             key.Binding
	ToggleJoinScreen key.Binding
	CloseTab         key.Binding
	EscapeJoinScreen key.Binding
	DumpScreen       key.Binding
}

type EmoteStore

type EmoteStore interface {
	GetByText(channel, text string) (emote.Emote, bool)
	RefreshLocal(ctx context.Context, channelID string) error
	RefreshGlobal(ctx context.Context) error
	GetAllForUser(id string) emote.EmoteSet
}

type HeaderKeyMap

type HeaderKeyMap struct {
	Next     key.Binding
	Previous key.Binding
}

type JoinKeyMap

type JoinKeyMap struct {
	FieldSelect key.Binding
	Enter       key.Binding
}

type KeyMap

type KeyMap struct {
	Down key.Binding
	Up   key.Binding
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns a set of pager-like default keybindings.

type Root

type Root struct {
	// contains filtered or unexported fields
}

func NewUI

func NewUI(logger zerolog.Logger, provider AccountProvider, emoteStore EmoteStore, clientID string, serverClient *server.Client) Root

func (Root) Init

func (r Root) Init() tea.Cmd

func (Root) TakeStateSnapshot

func (r Root) TakeStateSnapshot() save.AppState

func (Root) Update

func (r Root) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Root) View

func (r Root) View() string

Jump to

Keyboard shortcuts

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