tui

package
v0.0.0-...-8d1baa2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTheme

func ApplyTheme(t config.Theme)

ApplyTheme updates all themed style variables from the given config theme. Must be called before tui.New().

func New

func New(addr, nick, pass string, cfg config.Config) *model

New creates a new TUI model wired to connect to the given server.

Types

type Action

type Action string

Action identifies a user-facing operation triggered by a key binding.

const (
	ActionNextChannel Action = "next_channel"
	ActionPrevChannel Action = "prev_channel"
	ActionQuit        Action = "quit"
	ActionChat        Action = "chat"
	ActionCommand     Action = "command"
	ActionCancel      Action = "cancel"
	ActionSubmit      Action = "submit"
	ActionPaletteUp   Action = "palette_up"
	ActionPaletteDown Action = "palette_down"
	ActionScrollUp    Action = "scroll_up"
	ActionScrollDown  Action = "scroll_down"
	ActionJoin        Action = "join"
	ActionLeave       Action = "leave"
	ActionMsg         Action = "msg"
	ActionOpen        Action = "open"
	ActionMe          Action = "me"
	ActionNick        Action = "nick"
	ActionTheme       Action = "theme"
	ActionSet         Action = "set"
	ActionIRCQuit     Action = "irc_quit"
	ActionRawMode     Action = "raw_mode"
	ActionPicker      Action = "picker"
)

type ArgType

type ArgType int

ArgType identifies what kind of completion a command argument expects.

const (
	ArgChannel ArgType = iota + 1 // complete from available/joined channels
	ArgNick                       // complete from known nicks
	ArgTarget                     // channel or nick
	ArgSetting                    // complete from available settings
	ArgTheme                      // complete from available themes
)

type Command

type Command struct {
	Name        string
	Aliases     []string
	Desc        string
	Args        []ArgType // completion types for each positional argument
	Syntax      []string  // e.g. ["<#channel:channel>", "[code:string]"]
	Subcommands []Command // nested sub-subcommands
}

Command describes an IRC command available in the palette.

type KeyMap

type KeyMap struct {
	Normal map[string]Action
	Insert map[string]Action
}

KeyMap holds resolved key bindings for all modes.

func BuildKeyMap

func BuildKeyMap(cfg config.KeysConfig) KeyMap

BuildKeyMap constructs a KeyMap by merging user config onto defaults. User overrides individual keys; unspecified keys keep their defaults.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the built-in key bindings.

Jump to

Keyboard shortcuts

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