Versions in this module Expand all Collapse all v0 v0.1.0 Jul 18, 2026 Changes in this version + var ErrNoSelection = errors.New("flat: no file selected") + func ApplyUpdate[S any](s *S, tracer Tracer, update StateUpdate[S]) + func Async[S, T any](ctx context.Context, updates chan<- StateUpdate[S], spawn func(func()), ...) + func Cancel[S any](fx Effects[S], name string) + func Every[S any](fx Effects[S], name string, interval time.Duration, fold func(*S, time.Time)) + func Exec[S any](fx Effects[S], name string, cmd *exec.Cmd, fold func(*S, error)) + func Go[S, T any](fx Effects[S], name string, work func(context.Context) (T, error), ...) + func Latest[S, T any](fx Effects[S], name string, work func(context.Context) (T, error), ...) + func LoadState[S any](path string, defaultState S) S + func Run[S any](ctx context.Context, app App[S], opts ...Option) error + func SaveState[S any](path string, state S) error + func ScopeEvery[S any](scope *Scope, fx Effects[S], interval time.Duration, fold func(*S, time.Time)) + func ScopeGo[S, T any](scope *Scope, fx Effects[S], work func(context.Context) (T, error), ...) + func ScopeStream[S, T any](scope *Scope, fx Effects[S], source func(context.Context, func(T)), ...) + func SelectFile[S any](fx Effects[S], name string, cmd *exec.Cmd, fold func(*S, FileSelection)) + func Stream[S, T any](fx Effects[S], name string, source func(context.Context, func(T)), ...) + type App struct + Handle func(*S, Event, Effects[S]) + Init func(*S, Effects[S]) + OnExit func(*S) + State *S + Tracer Tracer + View func(*S, RenderContext) Frame + type ClipboardEvent struct + Text string + type Clock interface + Tick func(ctx context.Context, interval time.Duration, cb func(time.Time)) + type Cursor struct + Style *CursorStyle + X int + Y int + type CursorShape int + const CursorShapeBar + const CursorShapeBlock + const CursorShapeDefault + const CursorShapeUnderline + type CursorStyle struct + Blink bool + Color color.Color + Shape CursorShape + type Effects struct + Context context.Context + Updates chan<- StateUpdate[S] + func NewEffects[S any](ctx context.Context, updates chan<- StateUpdate[S], quit func()) Effects[S] + func NewHarnessEffects[S any](ctx context.Context, updates chan<- StateUpdate[S], quit func(), ...) Effects[S] + func (fx Effects[S]) Ctx() context.Context + func (fx Effects[S]) Print(s string) + func (fx Effects[S]) Printf(format string, args ...any) + func (fx Effects[S]) Quit() + func (fx Effects[S]) ReadClipboard() + func (fx Effects[S]) SetClipboard(text string) + func (fx Effects[S]) Suspend() + type Event interface + type FileSelection struct + Err error + Path string + type FocusEvent struct + Focused bool + type Frame struct + Content string + Cursor *Cursor + Title string + type Key int + const KeyBackspace + const KeyCharacter + const KeyCtrlC + const KeyDelete + const KeyDown + const KeyEnd + const KeyEnter + const KeyEscape + const KeyHome + const KeyLeft + const KeyPageDown + const KeyPageUp + const KeyRight + const KeyTab + const KeyUnknown + const KeyUp + type KeyEvent struct + Key Key + Mod Mod + Rune rune + type Mod int + const ModAlt + const ModCtrl + const ModShift + func (m Mod) Contains(mods Mod) bool + type MouseAction int + const MouseMotion + const MousePress + const MouseRelease + type MouseButton int + const MouseLeft + const MouseMiddle + const MouseNone + const MouseRight + const MouseWheelDown + const MouseWheelUp + type MouseEvent struct + Action MouseAction + Button MouseButton + Mod Mod + X int + Y int + type MouseMode int + const MouseModeAllMotion + const MouseModeCellMotion + const MouseModeNone + type NoopTracer struct + func (NoopTracer) Event(Event) + func (NoopTracer) Update(string) + type Option func(*runConfig) + func WithInline() Option + func WithInput(in io.Reader) Option + func WithMouse(mode MouseMode) Option + func WithOutput(out io.Writer) Option + func WithReportFocus() Option + func WithoutBracketedPaste() Option + func WithoutDefaultQuit() Option + type PasteEvent struct + Text string + type RenderContext struct + ColorProfile colorprofile.Profile + Width int + func RenderContextFor(out io.Writer) RenderContext + type ResizeEvent struct + Height int + Width int + type Scope struct + func NewScope[S any](fx Effects[S], name string) *Scope + func (s *Scope) Cancel() + func (s *Scope) Ctx() context.Context + type StateUpdate interface + Apply func(*S) + Name func() string + func Named[S any](name string, apply func(*S)) StateUpdate[S] + type Tracer interface + Event func(Event) + Update func(string) + type UpdateTracer func(string) + func (UpdateTracer) Event(Event) + func (f UpdateTracer) Update(name string)