terminal_backend.dart 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. /// returns whether the backend is ready to be used
  12. bool get isReady;
  13. /// Stream for data that gets read from the backend
  14. Stream<String> get out;
  15. /// Future that fires when the backend terminates
  16. Future<int> get exitCode;
  17. /// writes data to this backend
  18. void write(String input);
  19. /// notifies the backend about a view port resize that happened
  20. void resize(int width, int height, int pixelWidth, int pixelHeight);
  21. /// terminates this backend
  22. void terminate();
  23. /// acknowledges processing of a data junk
  24. void ackProcessed();
  25. }