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