terminal_backend.dart 958 B

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