2020-06-05 12:40:44 -04:00
|
|
|
package tea
|
|
|
|
|
2021-05-07 15:11:57 -04:00
|
|
|
// renderer is the interface for Bubble Tea renderers.
|
2021-02-09 13:33:25 -05:00
|
|
|
type renderer interface {
|
2021-05-19 21:35:36 -04:00
|
|
|
// Start the renderer.
|
2021-02-09 13:33:25 -05:00
|
|
|
start()
|
2021-05-19 21:35:36 -04:00
|
|
|
|
|
|
|
// Stop the renderer, but render the final frame in the buffer, if any.
|
2021-02-09 13:33:25 -05:00
|
|
|
stop()
|
2021-05-19 21:35:36 -04:00
|
|
|
|
|
|
|
// Stop the renderer without doing any final rendering.
|
|
|
|
kill()
|
|
|
|
|
|
|
|
// Write a frame to the renderer. The renderer can write this data to ouput
|
|
|
|
// at its discretion.
|
2021-02-09 13:33:25 -05:00
|
|
|
write(string)
|
2021-05-19 21:35:36 -04:00
|
|
|
|
|
|
|
// Request a full re-render.
|
2021-05-28 21:41:42 -04:00
|
|
|
repaint()
|
2021-05-19 21:35:36 -04:00
|
|
|
|
|
|
|
// Whether or not the alternate screen buffer is enabled.
|
2021-02-09 13:33:25 -05:00
|
|
|
altScreen() bool
|
2021-05-19 21:35:36 -04:00
|
|
|
|
|
|
|
// Record internally that the alternate screen buffer is enabled. This does
|
|
|
|
// should not actually toggle the alternate screen buffer.
|
2021-02-09 13:33:25 -05:00
|
|
|
setAltScreen(bool)
|
2020-06-17 18:43:01 -04:00
|
|
|
}
|