From 48599fe01e63ad7e6b1e4e4eb8d1e34032162779 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sun, 24 Feb 2019 17:08:44 -0500 Subject: [PATCH] Updated Terminal API (markdown) --- Terminal-API.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Terminal-API.md b/Terminal-API.md index 86db3bd..6d5da9e 100644 --- a/Terminal-API.md +++ b/Terminal-API.md @@ -2,7 +2,7 @@ [![Doc Status](https://godoc.org/github.com/mum4k/termdash/terminal/terminalapi?status.png)](https://godoc.org/github.com/mum4k/termdash/terminal/terminalapi) -The [terminalapi](https://github.com/mum4k/termdash/tree/master/terminal/terminalapi) package exposes types that are common to all terminal implementations. +The [terminalapi](https://github.com/mum4k/termdash/tree/master/terminal/terminalapi) package exposes types that are common to all terminal implementations. This abstraction was created so that users of Termdash can choose which low-level terminal library they prefer. The public API surface of this package consists of the following: @@ -12,18 +12,20 @@ All terminal implementations must implement this interface. ## [terminalapi.ColorMode](https://github.com/mum4k/termdash/blob/ffbf88caeddb1735dcf2a5f735eec80dc9cf9fe7/terminal/terminalapi/color_mode.go#L19-L20) -The **ColorMode** property specifies the amount of colors that can be displayed on a terminal and how are they addressed. +The **ColorMode** property specifies which colors can be displayed on the terminal and how are they addressed. Refer to the following pages which provide a list of colors and their numbers: - https://jonasjacek.github.io/colors/ - https://superuser.com/questions/783656/whats-the-deal-with-terminal-colors +Colors are set as options on terminal cells. Refer to the [[Cell API|cell-api]] for more details. + ## [terminalapi.Event](https://github.com/mum4k/termdash/blob/ffbf88caeddb1735dcf2a5f735eec80dc9cf9fe7/terminal/terminalapi/event.go#L28-L31) This interface represents an input terminal event, which can be one of the following events: -- A keyboard event. -- A mouse event. -- A terminal resize event. +- A keyboard event when a key is pressed. +- A mouse event when a mouse button is pressed or the mouse wheel is rolled. +- A terminal resize event when the size of the terminal window changes. - An error that occurs at the terminal layer or during event processing.