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()
|
|
|
|
|
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.
|
2021-02-09 13:33:25 -05:00
|
|
|
write(string)
|
2021-05-19 21:35:36 -04:00
|
|
|
|
2022-04-12 10:23:10 -04:00
|
|
|
// 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.
|
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
|
|
|
|
2021-08-23 17:16:59 -04:00
|
|
|
// Record internally that the alternate screen buffer is enabled. This
|
|
|
|
// does 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
|
|
|
}
|
2022-04-12 10:23:10 -04:00
|
|
|
|
|
|
|
// repaintMsg forces a full repaint.
|
|
|
|
type repaintMsg struct{}
|