terminal_backend.dart 912 B

12345678910111213141516171819202122232425262728
  1. import 'package:xterm/terminal/terminal_isolate.dart';
  2. /// interface for every Terminal backend
  3. abstract class TerminalBackend {
  4. /// initializes the backend
  5. /// This can be used to instantiate instances that are problematic when
  6. /// passed to a Isolate.
  7. /// The [TerminalIsolate] will pass the backend to the [Terminal] that then
  8. /// executes [init] from inside the Isolate.
  9. /// So when your backend needs any complex instances (most of them will)
  10. /// then strongly consider instantiating them here
  11. void init();
  12. /// Stream for data that gets read from the backend
  13. Stream<String> get out;
  14. /// Future that fires when the backend terminates
  15. Future<int> get exitCode;
  16. /// writes data to this backend
  17. void write(String input);
  18. /// notifies the backend about a view port resize that happened
  19. void resize(int width, int height);
  20. /// terminates this backend
  21. void terminate();
  22. }