native

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Generated by cargo run -p tui-test-bindgen. Do not edit.

Generated by cargo run -p tui-test-bindgen. Do not edit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAll

func CloseAll() error

func Milliseconds

func Milliseconds(timeout time.Duration) (uint64, error)

func Recording

func Recording(session string) (string, error)

func Sessions

func Sessions() ([]string, error)

Types

type ArtifactOptions

type ArtifactOptions struct {
	Directory        string
	Mode             string
	IncludeRecording bool
}

type AutomaticRecording

type AutomaticRecording struct {
	Mode      RecordingMode
	Directory string
}

type Backend

type Backend string
const (
	Alacritty Backend = "alacritty"
	Ghostty   Backend = "ghostty"
	Rio       Backend = "rio"
	XtermJS   Backend = "xtermjs"
)

type BellEvent

type BellEvent struct {
	Sequence uint64
	Elapsed  time.Duration
}

type Cell

type Cell struct {
	X, Y                                                            uint16
	Char                                                            string
	FG, BG                                                          Color
	Bold, Dim, Italic, Inverse, Invisible, Strike, Blink, Underline bool
	UnderlineStyle                                                  UnderlineStyle
	UnderlineColor                                                  Color
	Link, LinkID                                                    string
}

type ClipboardWaitOptions

type ClipboardWaitOptions struct {
	Text    *string
	Regex   bool
	Timeout *time.Duration
}

type Color

type Color string

type Colors

type Colors struct {
	Foreground, Background, Cursor                                                                        string
	Black, Red, Green, Yellow, Blue, Magenta, Cyan, White                                                 string
	BrightBlack, BrightRed, BrightGreen, BrightYellow, BrightBlue, BrightMagenta, BrightCyan, BrightWhite string
}

type Cursor

type Cursor struct {
	X, Y    uint16
	Visible bool
	Shape   string
	Color   string
}

type Direction

type Direction string
const (
	Within Direction = "within"
	After  Direction = "after"
	Before Direction = "before"
)

type EffectiveTimeouts

type EffectiveTimeouts struct{ Text, Idle, Command, Exit, Ready time.Duration }

type Error

type Error struct {
	Kind         ErrorKind
	Message      string
	DetailsJSON  []byte
	ArtifactJSON []byte
}

func (*Error) Error

func (failure *Error) Error() string

type ErrorKind

type ErrorKind string
const (
	AssertionError ErrorKind = "assertion"
	UsageError     ErrorKind = "usage"
	NoSessionError ErrorKind = "no_session"
	InternalError  ErrorKind = "internal"
)

type LocatorClickOptions

type LocatorClickOptions struct {
	MouseButtonOptions
	Clicks  *uint32
	Timeout *time.Duration
}

type LocatorExpectOptions

type LocatorExpectOptions struct {
	Not     bool
	Timeout *time.Duration
}

type LocatorExpression

type LocatorExpression struct {
	Nodes []LocatorNode `json:"nodes"`
	Root  uint32        `json:"root"`
}

type LocatorNode

type LocatorNode struct {
	Kind       string      `json:"kind"`
	Text       *string     `json:"text,omitempty"`
	Regex      *bool       `json:"regex,omitempty"`
	Whitespace *Whitespace `json:"whitespace,omitempty"`
	Style      *TextStyle  `json:"style,omitempty"`
	Link       *string     `json:"link,omitempty"`
	Full       *bool       `json:"full,omitempty"`
	Direction  *Direction  `json:"direction,omitempty"`
	Within     *uint32     `json:"within,omitempty"`
	Left       *uint32     `json:"left,omitempty"`
	Right      *uint32     `json:"right,omitempty"`
	Input      *uint32     `json:"input,omitempty"`
	Has        *uint32     `json:"has,omitempty"`
	HasNot     *uint32     `json:"has_not,omitempty"`
	Occurrence any         `json:"occurrence"`
}

type MouseButton

type MouseButton string
const (
	Left   MouseButton = "left"
	Middle MouseButton = "middle"
	Right  MouseButton = "right"
)

type MouseButtonOptions

type MouseButtonOptions struct {
	Button           MouseButton
	Alt, Ctrl, Shift bool
}

type MouseClickOptions

type MouseClickOptions struct {
	MouseButtonOptions
	X, Y   *uint16
	OnText *string
	Clicks *uint32
}

type OpenOptions

type OpenOptions struct {
	SpawnOptions
	Shell Shell
}

type OpenResult

type OpenResult struct {
	ShellPID  *uint32
	Session   string
	Ready     bool
	Recording string
}

type Profile

type Profile struct {
	Scrollback *uint32
	Colors     Colors
}

type RecordingFormat

type RecordingFormat string
const (
	APNG RecordingFormat = "apng"
	GIF  RecordingFormat = "gif"
	MP4  RecordingFormat = "mp4"
	Cast RecordingFormat = "cast"
)

type RecordingMode

type RecordingMode string
const (
	RecordingDisabled  RecordingMode = "disabled"
	RecordingOnFailure RecordingMode = "on-failure"
	RecordingAlways    RecordingMode = "always"
)

type RecordingOptions

type RecordingOptions struct {
	Format                     RecordingFormat
	FPS                        *uint32
	Speed, IdleTimeLimit, Zoom *float64
	Background                 string
	Transparent                bool
}

type ScreenshotOptions

type ScreenshotOptions struct {
	Full        bool
	Zoom        *float64
	Background  string
	Transparent bool
}

type ScrollDirection

type ScrollDirection string
const (
	Up   ScrollDirection = "up"
	Down ScrollDirection = "down"
)

type Session

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

func NewSession

func NewSession(name string, options SessionOptions) (*Session, error)

func (*Session) Cells

func (runtime *Session) Cells(column, row, width, height uint16) ([]Cell, error)

func (*Session) ClickLocator

func (runtime *Session) ClickLocator(expression LocatorExpression, options LocatorClickOptions) error

func (*Session) Close

func (runtime *Session) Close(failed *bool) error

func (*Session) ExpectBellCount

func (runtime *Session) ExpectBellCount(count uint64, timeout *time.Duration) error

func (*Session) ExpectExitCode

func (runtime *Session) ExpectExitCode(code int32, timeout *time.Duration) error

func (*Session) ExpectLocator

func (runtime *Session) ExpectLocator(expression LocatorExpression, options LocatorExpectOptions) error

func (*Session) ExpectOutput

func (runtime *Session) ExpectOutput(text string, regex bool) error

func (*Session) ExpectTitle

func (runtime *Session) ExpectTitle(text string, options TitleOptions) error

func (*Session) FindLocator

func (runtime *Session) FindLocator(expression LocatorExpression, requireOne bool) ([]TextMatch, error)

func (*Session) GetBellCount

func (runtime *Session) GetBellCount() (uint64, error)

func (*Session) GetBellEvents

func (runtime *Session) GetBellEvents() ([]BellEvent, error)

func (*Session) GetClipboard

func (runtime *Session) GetClipboard() (string, error)

func (*Session) GetCommand

func (runtime *Session) GetCommand() (*string, error)

func (*Session) GetCursor

func (runtime *Session) GetCursor() (Cursor, error)

func (*Session) GetCwd

func (runtime *Session) GetCwd() (*string, error)

func (*Session) GetExitCode

func (runtime *Session) GetExitCode() (*int32, error)

func (*Session) GetOutput

func (runtime *Session) GetOutput() (*string, error)

func (*Session) GetSize

func (runtime *Session) GetSize() (Size, error)

func (*Session) GetTitle

func (runtime *Session) GetTitle() (*string, error)

func (*Session) GetViewport

func (runtime *Session) GetViewport() (Viewport, error)

func (*Session) HighlightLocator

func (runtime *Session) HighlightLocator(expression LocatorExpression, timeout *time.Duration) error

func (*Session) Key

func (runtime *Session) Key(keys []string, action uint32) error

func (*Session) MouseClick

func (runtime *Session) MouseClick(options MouseClickOptions) error

func (*Session) MouseDown

func (runtime *Session) MouseDown(column, row uint16, options MouseButtonOptions) error

func (*Session) MouseDrag

func (runtime *Session) MouseDrag(x1, y1, x2, y2 uint16, options MouseButtonOptions) error

func (*Session) MouseMove

func (runtime *Session) MouseMove(column, row uint16) error

func (*Session) MouseScroll

func (runtime *Session) MouseScroll(direction ScrollDirection, amount uint32) error

func (*Session) MouseUp

func (runtime *Session) MouseUp(column, row uint16, options MouseButtonOptions) error

func (*Session) Open

func (runtime *Session) Open(options OpenOptions) (OpenResult, error)

func (*Session) Resize

func (runtime *Session) Resize(cols, rows uint16) error

func (*Session) Restart

func (runtime *Session) Restart(gracefulTimeout time.Duration) (OpenResult, error)

func (*Session) Run

func (runtime *Session) Run(program string, args []string, options SpawnOptions) (OpenResult, error)

func (*Session) Screenshot

func (runtime *Session) Screenshot(path string, options ScreenshotOptions) (string, error)

func (*Session) Scroll

func (runtime *Session) Scroll(lines int32) error

func (*Session) ScrollToBottom

func (runtime *Session) ScrollToBottom() error

func (*Session) ScrollToTop

func (runtime *Session) ScrollToTop() error

func (*Session) Signal

func (runtime *Session) Signal(text string) error

func (*Session) Snapshot

func (runtime *Session) Snapshot(name string, options SnapshotOptions) (SnapshotResult, error)

func (*Session) StartRecording

func (runtime *Session) StartRecording(path string, options RecordingOptions) error

func (*Session) State

func (runtime *Session) State() (State, error)

func (*Session) StopRecording

func (runtime *Session) StopRecording() (string, error)

func (*Session) Submit

func (runtime *Session) Submit(text *string) error

func (*Session) Text

func (runtime *Session) Text(full bool) (string, error)

func (*Session) TypeText

func (runtime *Session) TypeText(text string) error

func (*Session) WaitBell

func (runtime *Session) WaitBell(timeout *time.Duration) error

func (*Session) WaitClipboard

func (runtime *Session) WaitClipboard(options ClipboardWaitOptions) error

func (*Session) WaitCommand

func (runtime *Session) WaitCommand(timeout *time.Duration) error

func (*Session) WaitExit

func (runtime *Session) WaitExit(timeout *time.Duration) error

func (*Session) WaitIdle

func (runtime *Session) WaitIdle(timeout *time.Duration) error

func (*Session) WaitLocator

func (runtime *Session) WaitLocator(expression LocatorExpression, hidden bool, timeout *time.Duration) error

func (*Session) WaitReady

func (runtime *Session) WaitReady(timeout *time.Duration) error

func (*Session) WaitTitle

func (runtime *Session) WaitTitle(text string, options TitleOptions) error

func (*Session) Write

func (runtime *Session) Write(text string) error

type SessionOptions

type SessionOptions struct {
	Recording          *AutomaticRecording
	Artifacts          *ArtifactOptions
	Trace              *TraceOptions
	ScreenHistoryLimit *uint16
}

type Shell

type Shell string
const (
	Bash       Shell = "bash"
	PowerShell Shell = "powershell"
	Pwsh       Shell = "pwsh"
	Cmd        Shell = "cmd"
	Fish       Shell = "fish"
	Zsh        Shell = "zsh"
	Xonsh      Shell = "xonsh"
	Elvish     Shell = "elvish"
	Nushell    Shell = "nushell"
)

type Size

type Size struct{ Cols, Rows uint16 }

type SnapshotOptions

type SnapshotOptions struct {
	Update, IncludeStyle, IncludeTitle bool
	Cwd                                string
}

type SnapshotResult

type SnapshotResult string
const (
	SnapshotPassed  SnapshotResult = "passed"
	SnapshotWritten SnapshotResult = "written"
	SnapshotUpdated SnapshotResult = "updated"
)

type SpawnOptions

type SpawnOptions struct {
	Backend            Backend
	Cols, Rows         *uint16
	Cwd                string
	Env                map[string]string
	WaitReady, Restart *bool
	Profile            *Profile
	Timeouts           Timeouts
}

type State

type State struct {
	SessionShell            *string
	Cols, Rows              uint16
	Cursor                  Cursor
	Title, Cwd, LastCommand *string
	LastExit                *int32
	ExitSignal              *string
	Exited                  *int32
	Ready                   bool
	BellCount               uint64
	Modes                   map[string]bool
	MouseMode               string
	Colors                  TerminalColors
	Timeouts                EffectiveTimeouts
	Text                    string
}

type TerminalColors

type TerminalColors struct {
	Foreground, Background, Cursor string
	Palette                        map[uint8]string
}

type TextMatch

type TextMatch struct {
	Text       string
	Start, End TextPosition
	Spans      []TextSpan
}

type TextPosition

type TextPosition struct{ Row, Column uint32 }

type TextSpan

type TextSpan struct{ Row, Start, End uint32 }

type TextStyle

type TextStyle struct {
	Foreground     *string         `json:"foreground,omitempty"`
	Background     *string         `json:"background,omitempty"`
	Bold           *bool           `json:"bold,omitempty"`
	Dim            *bool           `json:"dim,omitempty"`
	Italic         *bool           `json:"italic,omitempty"`
	UnderlineStyle *UnderlineStyle `json:"underline_style,omitempty"`
	UnderlineColor *string         `json:"underline_color,omitempty"`
	Inverse        *bool           `json:"inverse,omitempty"`
	Hidden         *bool           `json:"hidden,omitempty"`
	Strikethrough  *bool           `json:"strikethrough,omitempty"`
	Blink          *bool           `json:"blink,omitempty"`
}

type Timeouts

type Timeouts struct{ Text, Idle, Command, Exit, Ready *time.Duration }

type TitleOptions

type TitleOptions struct {
	Regex, Not bool
	Timeout    *time.Duration
}

type TraceOptions

type TraceOptions struct {
	Mode, Directory string
}

type UnderlineStyle

type UnderlineStyle string
const (
	UnderlineNone   UnderlineStyle = "none"
	UnderlineSingle UnderlineStyle = "single"
	UnderlineDouble UnderlineStyle = "double"
	UnderlineCurly  UnderlineStyle = "curly"
	UnderlineDotted UnderlineStyle = "dotted"
	UnderlineDashed UnderlineStyle = "dashed"
)

type Viewport

type Viewport struct{ Offset, History uint64 }

type Whitespace

type Whitespace string
const (
	Exact     Whitespace = "exact"
	Normalize Whitespace = "normalize"
)

Jump to

Keyboard shortcuts

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