namespace Terminal.Gui.App; /// /// Interface for the main loop coordinator that manages UI loop initialization and threading. /// /// /// The coordinator is responsible for: /// /// Starting the asynchronous input reading thread /// Initializing the main UI loop on the application thread /// Coordinating clean shutdown of both threads /// /// public interface IMainLoopCoordinator { /// /// Initializes all required subcomponents and starts the input thread. /// /// /// This method: /// /// Starts the input thread that reads console input asynchronously /// Initializes the main UI loop on the calling thread /// Waits for both to be ready before returning /// /// /// A task that completes when initialization is done public Task StartInputTaskAsync (); /// /// Stops the input thread and performs cleanup. /// /// /// This method blocks until the input thread has exited. /// It must be called only from the main UI thread. /// public void Stop (); /// /// Executes a single iteration of the main UI loop. /// /// /// Each iteration processes input, runs timeouts, checks for UI changes, /// and renders any necessary updates. /// void RunIteration (); }