internal

package
v0.0.0-...-3b09bce Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor interface {
	MoveCursorUp(lines int)
	MoveCursorDown(lines int)
	MoveCursorLeft(columns int)
	MoveCursorRight(columns int)
	MoveCursorToStartOfLine()
	HideCursor()
	ShowCursor()
}

Cursor is a base component for UX components that require cursor manipulation.

func NewCursor

func NewCursor(writer io.Writer) Cursor

type Input

type Input struct {
	SigChan chan os.Signal
	// contains filtered or unexported fields
}

Input is a base component for UX components that require user input.

func NewInput

func NewInput() *Input

NewInput creates a new Input instance.

func (*Input) ReadInput

func (i *Input) ReadInput(config *InputConfig) (<-chan InputEventArgs, func(), error)

ReadInput reads user input from the keyboard.

func (*Input) ResetValue

func (i *Input) ResetValue()

ResetValue resets the value of the input.

type InputConfig

type InputConfig struct {
	InitialValue   string
	IgnoreHintKeys bool
}

type InputEventArgs

type InputEventArgs struct {
	Value string
	Char  rune
	Key   keyboard.Key
	Hint  bool
}

Jump to

Keyboard shortcuts

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