| 1 |
/// Terminal input. |
| 2 |
/// |
| 3 |
/// In the future, this may include functions for disabling echoing, |
| 4 |
/// disabling input buffering so that keyboard events are sent through |
| 5 |
/// immediately, querying supported features, and so on. |
| 6 |
@since(version = 0.2.0) |
| 7 |
interface terminal-input { |
| 8 |
/// The input side of a terminal. |
| 9 |
@since(version = 0.2.0) |
| 10 |
resource terminal-input; |
| 11 |
} |
| 12 |
|
| 13 |
/// Terminal output. |
| 14 |
/// |
| 15 |
/// In the future, this may include functions for querying the terminal |
| 16 |
/// size, being notified of terminal size changes, querying supported |
| 17 |
/// features, and so on. |
| 18 |
@since(version = 0.2.0) |
| 19 |
interface terminal-output { |
| 20 |
/// The output side of a terminal. |
| 21 |
@since(version = 0.2.0) |
| 22 |
resource terminal-output; |
| 23 |
} |
| 24 |
|
| 25 |
/// An interface providing an optional `terminal-input` for stdin as a |
| 26 |
/// link-time authority. |
| 27 |
@since(version = 0.2.0) |
| 28 |
interface terminal-stdin { |
| 29 |
@since(version = 0.2.0) |
| 30 |
use terminal-input.{terminal-input}; |
| 31 |
|
| 32 |
/// If stdin is connected to a terminal, return a `terminal-input` handle |
| 33 |
/// allowing further interaction with it. |
| 34 |
@since(version = 0.2.0) |
| 35 |
get-terminal-stdin: func() -> option<terminal-input>; |
| 36 |
} |
| 37 |
|
| 38 |
/// An interface providing an optional `terminal-output` for stdout as a |
| 39 |
/// link-time authority. |
| 40 |
@since(version = 0.2.0) |
| 41 |
interface terminal-stdout { |
| 42 |
@since(version = 0.2.0) |
| 43 |
use terminal-output.{terminal-output}; |
| 44 |
|
| 45 |
/// If stdout is connected to a terminal, return a `terminal-output` handle |
| 46 |
/// allowing further interaction with it. |
| 47 |
@since(version = 0.2.0) |
| 48 |
get-terminal-stdout: func() -> option<terminal-output>; |
| 49 |
} |
| 50 |
|
| 51 |
/// An interface providing an optional `terminal-output` for stderr as a |
| 52 |
/// link-time authority. |
| 53 |
@since(version = 0.2.0) |
| 54 |
interface terminal-stderr { |
| 55 |
@since(version = 0.2.0) |
| 56 |
use terminal-output.{terminal-output}; |
| 57 |
|
| 58 |
/// If stderr is connected to a terminal, return a `terminal-output` handle |
| 59 |
/// allowing further interaction with it. |
| 60 |
@since(version = 0.2.0) |
| 61 |
get-terminal-stderr: func() -> option<terminal-output>; |
| 62 |
} |