IConsoleOutput.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Interface for writing console output
  4. /// </summary>
  5. public interface IConsoleOutput : IDisposable
  6. {
  7. /// <summary>
  8. /// Writes the given text directly to the console. Use to send
  9. /// ansi escape codes etc. Regular screen output should use the
  10. /// <see cref="IOutputBuffer"/> overload.
  11. /// </summary>
  12. /// <param name="text"></param>
  13. void Write (ReadOnlySpan<char> text);
  14. /// <summary>
  15. /// Write the contents of the <paramref name="buffer"/> to the console
  16. /// </summary>
  17. /// <param name="buffer"></param>
  18. void Write (IOutputBuffer buffer);
  19. /// <summary>
  20. /// Returns the current size of the console window in rows/columns (i.e.
  21. /// of characters not pixels).
  22. /// </summary>
  23. /// <returns></returns>
  24. public Size GetWindowSize ();
  25. /// <summary>
  26. /// Updates the console cursor (the blinking underscore) to be hidden,
  27. /// visible etc.
  28. /// </summary>
  29. /// <param name="visibility"></param>
  30. void SetCursorVisibility (CursorVisibility visibility);
  31. /// <summary>
  32. /// Moves the console cursor to the given location.
  33. /// </summary>
  34. /// <param name="col"></param>
  35. /// <param name="row"></param>
  36. void SetCursorPosition (int col, int row);
  37. }