bubbletea/renderer.go

63 lines
1.7 KiB
Go
Raw Permalink Normal View History

2020-06-05 12:40:44 -04:00
package tea
// renderer is the interface for Bubble Tea renderers.
type renderer interface {
// Start the renderer.
start()
// Stop the renderer, but render the final frame in the buffer, if any.
stop()
// Stop the renderer without doing any final rendering.
kill()
2021-08-23 17:16:59 -04:00
// Write a frame to the renderer. The renderer can write this data to
// output at its discretion.
write(string)
// Request a full re-render. Note that this will not trigger a render
// immediately. Rather, this method causes the next render to be a full
// repaint. Because of this, it's safe to call this method multiple times
// in succession.
repaint()
2022-08-25 13:13:30 -04:00
// Clears the terminal.
clearScreen()
// Whether or not the alternate screen buffer is enabled.
altScreen() bool
2022-10-03 18:04:05 -04:00
// Enable the alternate screen buffer.
enterAltScreen()
// Disable the alternate screen buffer.
exitAltScreen()
// Show the cursor.
showCursor()
// Hide the cursor.
hideCursor()
// enableMouseCellMotion enables mouse click, release, wheel and motion
// events if a mouse button is pressed (i.e., drag events).
enableMouseCellMotion()
// disableMouseCellMotion disables Mouse Cell Motion tracking.
2022-10-03 18:04:05 -04:00
disableMouseCellMotion()
// enableMouseAllMotion enables mouse click, release, wheel and motion
2022-10-03 18:04:05 -04:00
// events, regardless of whether a mouse button is pressed. Many modern
// terminals support this, but not all.
enableMouseAllMotion()
// disableMouseAllMotion disables All Motion mouse tracking.
2022-10-03 18:04:05 -04:00
disableMouseAllMotion()
// enableMouseSGRMode enables mouse extended mode (SGR).
enableMouseSGRMode()
// disableMouseSGRMode disables mouse extended mode (SGR).
disableMouseSGRMode()
}
// repaintMsg forces a full repaint.
type repaintMsg struct{}