|
| 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 | +interface terminal-input { |
| 7 | + /// The input side of a terminal. |
| 8 | + resource terminal-input; |
| 9 | +} |
| 10 | + |
| 11 | +/// Terminal output. |
| 12 | +/// |
| 13 | +/// In the future, this may include functions for querying the terminal |
| 14 | +/// size, being notified of terminal size changes, querying supported |
| 15 | +/// features, and so on. |
| 16 | +interface terminal-output { |
| 17 | + /// The output side of a terminal. |
| 18 | + resource terminal-output; |
| 19 | +} |
| 20 | + |
| 21 | +/// An interface providing an optional `terminal-input` for stdin as a |
| 22 | +/// link-time authority. |
| 23 | +interface terminal-stdin { |
| 24 | + use terminal-input.{terminal-input}; |
| 25 | + |
| 26 | + /// If stdin is connected to a terminal, return a `terminal-input` handle |
| 27 | + /// allowing further interaction with it. |
| 28 | + get-terminal-stdin: func() -> option<terminal-input>; |
| 29 | +} |
| 30 | + |
| 31 | +/// An interface providing an optional `terminal-output` for stdout as a |
| 32 | +/// link-time authority. |
| 33 | +interface terminal-stdout { |
| 34 | + use terminal-output.{terminal-output}; |
| 35 | + |
| 36 | + /// If stdout is connected to a terminal, return a `terminal-output` handle |
| 37 | + /// allowing further interaction with it. |
| 38 | + get-terminal-stdout: func() -> option<terminal-output>; |
| 39 | +} |
| 40 | + |
| 41 | +/// An interface providing an optional `terminal-output` for stderr as a |
| 42 | +/// link-time authority. |
| 43 | +interface terminal-stderr { |
| 44 | + use terminal-output.{terminal-output}; |
| 45 | + |
| 46 | + /// If stderr is connected to a terminal, return a `terminal-output` handle |
| 47 | + /// allowing further interaction with it. |
| 48 | + get-terminal-stderr: func() -> option<terminal-output>; |
| 49 | +} |
0 commit comments