v0.1.0 initial commit

This commit is contained in:
2026-07-12 18:41:05 -04:00
commit aa22225c61
69 changed files with 10971 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package terminal
// Backend abstracts platform-specific terminal operations.
// This interface allows the terminal package to support both
// native Unix environments and WASM/Browser environments (via xterm.js).
type Backend interface {
// Lifecycle
Init() error
Fini()
// Capabilities
Size() (width, height int)
// I/O
// Write writes raw bytes to the terminal output.
Write(p []byte) error
// Read blocks until input is available, the stop channel is closed, or an error occurs.
Read(stopCh <-chan struct{}) ([]byte, error)
// Callbacks
// SetResizeHandler registers a callback for terminal resize events.
SetResizeHandler(handler func(width, height int))
}